Package fixtures teardown not being invoked after package scope #10992
Labels
topic: fixtures
anything involving fixtures directly or indirectly
type: question
general question, might be closed after 2 weeks of inactivity
Hello, I'm currently trying to separate some package fixtures from some local conftest.py files. I know that this is not expected behaviour, but it actually works for my team setup. It look something something like this:
Python version:
3.11.3
Pytest version:
7.3.1
Project structure:
tests/test_1/fixtures/fix.py
andtests/test_2/fixtures/fix.py
tests/test_1/conftest.py
andtests/test_2/conftest.py
tests/test_1/foo/test_foo.py
andtests/test_2/bar/test_bar.py
When calling the fixtures in our tests with this modularisation, the fixture remains only available on the conftest.py level, and the startup of the fixture is also invoked by its first occurrence, but its teardown is deferred by beyond the end of the related package. Something like this:
Is there any reason why this is happening and how can I enforce the package scope?
The text was updated successfully, but these errors were encountered: