Skip to content

Commit 1836651

Browse files
committed
Lower the scope of simple_script fixture to apply isolate to it
Lower the scope of `simple_script` fixture used in `test_inspect` from `session` to (implicit) `function`, to make it match the `isolate` fixture and therefore make the fixture run in isolation. Per the documentation [1], pytest initializes higher-scope fixtures first, and lower-scope fixtures cannot be used in them. Since within the same scope, autouse fixtures are always loaded before regular fixtures, no further adjustment is necessary. This should have no ill side effects, as the fixture is used by a single test only. [1] https://docs.pytest.org/en/stable/reference/fixtures.html#fixture-instantiation-order
1 parent f84d782 commit 1836651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/functional/test_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from tests.lib import PipTestEnvironment, ScriptFactory, TestData
66

77

8-
@pytest.fixture(scope="session")
8+
@pytest.fixture
99
def simple_script(
1010
tmpdir_factory: pytest.TempPathFactory,
1111
script_factory: ScriptFactory,

0 commit comments

Comments
 (0)