A fixture with autouse set to False will always be used if it overrides a fixture with autouse set to True #3225
Labels
topic: fixtures
anything involving fixtures directly or indirectly
type: bug
problem that needs to be addressed
I took a look at pytest's source code and it looks like pytest records the names of all fixtures with autouse set to True. It then uses this list to determine which fixtures to use, even if the overriding fixture has autouse set to False.
platform linux2 -- Python 2.7.13, pytest-3.4.0, py-1.5.2, pluggy-0.6.0
conftest.py
test_me.py:
Returns the following error:
I expect only test_bar to fail. Setting autouse to False for foo in conftest.py correctly causes only test_bar to fail.
The text was updated successfully, but these errors were encountered: