-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue when
@parametrize_with_cases
was used on a fixture in a…
… `conftest.py`. Fixes #196
- Loading branch information
Sylvain MARIE
committed
Apr 7, 2021
1 parent
937f7d0
commit 710bbcb
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pytest_cases import fixture, parametrize_with_cases | ||
|
||
|
||
def case_a(): | ||
return 1 | ||
|
||
|
||
@fixture | ||
@parametrize_with_cases("a", cases=case_a) | ||
def dummy_fixture(a): | ||
return a + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def test_foo(dummy_fixture): | ||
"""Before the fix this test would not even start because a conftest loading error was appearing""" | ||
assert dummy_fixture == 2 |