params
on Fixtures are silently hidden when the Fixture is shadowed but used
#11337
Labels
topic: fixtures
anything involving fixtures directly or indirectly
topic: parametrize
related to @pytest.mark.parametrize
Issue
params
on fixtures that are shadowed but used are silently dropped.Example
this result in something like
I expect to atleast get a warning that the
params
on the inner fixture are overwritten by theparams
on the outer oneNote I:
I actually hoped to get all four cases (
outer-inner
,outer-near
,far-inner
,far-near
), but i guess that wont happen anytime (see Note III)Note II:
The fixture
b
is only included to demonstrate that the inner fixture is/can be accessed when necessary.Increasing the scope on the inner fixture does not change anything.
Note III:
I am aware that the current behaviour (ignoring the params on the inner fixture) is the current way to make indirect parameters in
pytest.mark.parametrize
work, becausepytest.mark.parametrize
in effect just shadows fixtures.Sytem Info:
pytest-7.4.0
win10 & python 3.11
The text was updated successfully, but these errors were encountered: