@pytest.fixture(scope="package") works like session if placed in one file and used with pytest_plugins in conftest.py #7232
Labels
topic: fixtures
anything involving fixtures directly or indirectly
Hello.
I'm using pytest==5.4.1.
I have conftest.py file in root of the directory with content like this:
my fixtures are placed in separate folder 'fixtures'.
When I run some fixture, which is defined in fixtures.configuration with scope "package" it's executed as session fixture. So I suppose this package scope realted to where fixtures are placed, than to where they're called. Is it expected behavior? if I want to use pytest_plugins in conftest.py this looks a bit inconvenient.
This can be tested by.
Creating conftest.py in root of directory with content:
Creating fixtures folder with myfxitures.py file inside of it with content.
Creating package 'some' with two packages inside: 'hello', 'world'.
with files inside with content like
hello_test.py
world_test.py
running: pytest -sv some
result:
expected result:
The text was updated successfully, but these errors were encountered: