test: keep subprocess imports on the active worktree
This commit is contained in:
1 parent
eabf61c73b
commit
5b7e7bea2f
3 files changed
+26
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
"""Keep subprocess imports on the worktree being tested."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def pytest_configure():
|
||||
source = str(Path(__file__).resolve().parents[1] / 'src')
|
||||
existing = os.environ.get('PYTHONPATH', '').split(os.pathsep)
|
||||
os.environ['PYTHONPATH'] = os.pathsep.join(
|
||||
[source, *(entry for entry in existing if entry and entry != source)])
|
||||
Reference in new issue
Block a user