File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change
1
+ Avoid race conditions in tests using the ``demo_pkg_inline `` fixture.
Original file line number Diff line number Diff line change 11
11
from _pytest .monkeypatch import MonkeyPatch # cannot import from tox.pytest yet
12
12
from _pytest .tmpdir import TempPathFactory
13
13
from distlib .scripts import ScriptMaker
14
+ from filelock import FileLock
14
15
from pytest_mock import MockerFixture
15
16
from virtualenv import cli_run
16
17
@@ -77,8 +78,10 @@ def demo_pkg_setuptools() -> Path:
77
78
78
79
79
80
@pytest .fixture (scope = "session" )
80
- def demo_pkg_inline () -> Path :
81
- return HERE / "demo_pkg_inline"
81
+ def demo_pkg_inline () -> Iterator [Path ]:
82
+ demo_path = HERE / "demo_pkg_inline"
83
+ with FileLock (f"{ demo_path } .lock" ):
84
+ yield demo_path
82
85
83
86
84
87
@pytest .fixture ()
You can’t perform that action at this time.
0 commit comments