no parameter defined for test
error when overriding a fixture that requests a parametrized fixture
#11075
Labels
topic: fixtures
anything involving fixtures directly or indirectly
python 3.11 - pytest 7.3.1 - archlinux
Related issues #1953 #2043
The situation is a bit convoluted: if a fixture requests a parametrized fixture, and is overridden with different params, then it raises a
The requested fixture has no parameter defined for test
error.I encountered this in a real-life project. I simplified all that I could to make an example demonstrating this behavior. Obviously this example does not seem very relevant, but in my real usecase I do need the overriding
fixture_bar
to have a param to the mainfixture_bar
.The error won't happen if:
fixture_foo
is not parametrized orfixture_bar
also have afixture_foo
paramIt took me a while to find how to fix the issue, but this second workaround is simple enough. However I could not find any documentation about this.
I suggest to either fix this behavior, or document it.
What do you think?
The text was updated successfully, but these errors were encountered: