You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coverage does not work as expected because we need to do one pytest and not 3. We could parameterize with multiple engines by changing the pytest command to:
Not sure how to do this but I'll try. If anyone wants to give me a quick example so I can reproduce it on all tests that would be appreciated 👍 !
I think the configuration I locally updated in conftest.py is correct (see below) so we just have to change the tests.
defpytest_addoption(parser):
parser.addoption('--sqlite_conn', action="store")
parser.addoption('--pg_conn', action="store")
parser.addoption('--mysql_conn', action="store")
parser.addoption('--pg_schema', action='store', default=None)
defpytest_generate_tests(metafunc):
# This is called for every test. Only get/set command line arguments# if the argument is specified in the list of test "fixturenames".conn_strings= {'sqlite':metafunc.config.option.sqlite_conn,
'pg':metafunc.config.option.pg_conn,
'mysql':metafunc.config.option.mysql_conn}
engines= []
schemas= []
fordb_type, conn_stringinconn_strings.items():
schema=metafunc.config.option.pg_schemaifdb_type=='pg'elseNoneengine=create_engine(conn_string)
schemas.append(schema)
engines.append(engine)
metafunc.parametrize("engine", engines)
metafunc.parametrize("schema", schemas)
The text was updated successfully, but these errors were encountered:
Coverage does not work as expected because we need to do one pytest and not 3. We could parameterize with multiple engines by changing the pytest command to:
However the order is not how it should be for our tests:
I will try to fix this with classes as proposed here: https://stackoverflow.com/a/31966811/10551772
Not sure how to do this but I'll try. If anyone wants to give me a quick example so I can reproduce it on all tests that would be appreciated 👍 !
I think the configuration I locally updated in conftest.py is correct (see below) so we just have to change the tests.
The text was updated successfully, but these errors were encountered: