"fixture 'schema' not found" when trying to skip a suite test under 2.0

17 views
Skip to first unread message

gordon.d...@gmail.com

unread,
Oct 14, 2022, 12:28:04 PM10/14/22
to sqlalchemy-devel
I'm checking the version 2.0 test suite against sqlalchemy-cockroachdb. I'm not planning to fully implement get_multi_columns() right away, so I want to skip the related tests. As in previous cases, I have the following in test/test_suite_sqlalchemy.py :

```python
from sqlalchemy.testing.suite import ComponentReflectionTest as _ComponentReflectionTest

class ComponentReflectionTest(_ComponentReflectionTest):
   
    @skip("cockroachdb")  # noqa
    def test_get_multi_columns(
            self, get_multi_exp, schema, scope, kind, use_filter
    ):
        pass
```

That produces the error

```
___________________ ERROR at setup of ComponentReflectionTest_cockroachdb+psycopg2_9_5_0.test_get_multi_columns ____________________
file /home/gord/git/sqlalchemy-cockroachdb/test/test_suite_sqlalchemy.py, line 27
      @skip("cockroachdb")  # noqa
      def test_get_multi_columns(
E       fixture 'schema' not found
>       available fixtures: _setup_tables_test_class, _setup_tables_test_instance, async_testing_engine, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, close_result_when_finished, collect_types_fixture, connection, connection_no_trans, dc_decl_base, decl_base, doctest_namespace, fixture_session, future_connection, future_engine, get_multi_exp, metadata, monkeypatch, nocache, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, registry, setup_class_methods, setup_test_methods, testing_engine, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, trans_ctx_manager_fixture, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.
```

Is this missing "fixture" something that needs to be added to the 2.0 test setup, or am I doing something wrong?

Mike Bayer

unread,
Oct 14, 2022, 12:44:46 PM10/14/22
to sqlalche...@googlegroups.com
well that argument is based on a @testing.combinations() decorator that's on the actual test.  I think you can remove all the arguments from the method since you are overriding the test to do nothing.

that said, "get_multi_columns()" is already implemented for every dialect automatically so as long as you support get_columns() you shouldn't have to skip that test.  if this were a feature that existing dialects didn't support, we'd have marked those tests as needing the feature enabled.   I just ran those tests on SQlite just to check and as expected they use the original get_columns() method to implement.
--
You received this message because you are subscribed to the Google Groups "sqlalchemy-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-dev...@googlegroups.com.

Federico Caselli

unread,
Oct 15, 2022, 8:35:29 AM10/15/22
to sqlalchemy-devel
Like mike said you should be able to run all these fixtures without implementing the multi reflection.
Mysql, sqlite and mssql do run them and they don't support multi reflection, but use the compat implementation that fallbacks on the existing methods
Reply all
Reply to author
Forward
0 new messages