Skip to content

Commit

Permalink
Prevent failure if backend not in metafunc.config
Browse files Browse the repository at this point in the history
see #46
  • Loading branch information
windiana42 committed Dec 8, 2022
1 parent bd2122e commit a092cda
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def pytest_addoption(parser):

def pytest_generate_tests(metafunc):
if "backend" in metafunc.fixturenames:
metafunc.parametrize(
"backend", [metafunc.config.getoption("backend")], scope="module"
)
try:
metafunc.parametrize(
"backend", [metafunc.config.getoption("backend")], scope="module"
)
except ValueError:
# some metafunc.config objects don't have an option "backend"
metafunc.parametrize(
"backend", ["default_backend"], scope="module"
)

0 comments on commit a092cda

Please sign in to comment.