New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_LazyValueCaseParamValue
is injected instead of the case function result
#274
Comments
The bug does not happen when the cases are used to parametrize the test (not a fixture). import pytest
from pytest_cases import 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
@parametrize_with_cases("dset", cases=DataCases, prefix="data_", debug=True)
def test_foo(dset):
assert dset == 1 |
Decoding what happens in the original (failing) example:
We can see this in the debug log enabled using debug = True :
|
smarie
pushed a commit
that referenced
this issue
May 20, 2022
…resolved before being injected in a parametrized function, and was therefore appearing as a `_LazyValueCaseParamValue `. Fixed #274
smarie
added a commit
that referenced
this issue
May 20, 2022
…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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When at least two "basic" cases are present next to each other in a set of cases where there is at least a fixture case (parameterized case or case requiring a fixture), then the case function is not called and a
_LazyValueCaseParamValue
is wrongly injected.Reproducible example:
yields
The text was updated successfully, but these errors were encountered: