-
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 lazy value resolution issue when multiple consecutive lazy valu…
…es are present in a @parametrize containing a fixture_ref (#275) * Fixed issue where a lazy value (for example a case function) was not resolved before being injected in a parametrized function, and was therefore appearing as a `_LazyValueCaseParamValue `. Fixed #274 * 3.6.13 changelog Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
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
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,33 @@ | ||
import pytest | ||
from pytest_cases import fixture, parametrize_with_cases | ||
|
||
|
||
class DataCases: | ||
def data_dummy(self): | ||
return 1 | ||
|
||
def data_dummy2(self): | ||
return 1 | ||
|
||
@pytest.mark.parametrize("a", [False]) | ||
def data_dummy3(self, a): | ||
return 1 | ||
|
||
|
||
@fixture | ||
@parametrize_with_cases("dset", cases=DataCases, prefix="data_", debug=True) | ||
def dataset(dset): | ||
assert dset == 1 | ||
yield dset | ||
|
||
|
||
def test_foo(dataset): | ||
assert dataset == 1 | ||
|
||
|
||
def test_synthesis(module_results_dct): | ||
assert list(module_results_dct) == [ | ||
'test_foo[dummy]', | ||
'test_foo[dummy2]', | ||
'test_foo[dummy3-False]', | ||
] |