From 07fab63153d8937a4fbf8a8d35ebe3597c1ffdfe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 2 Apr 2024 10:20:11 -0400 Subject: [PATCH] Inject the current directory to sys.path in multiprocessing tests. Closes #673. Ref pytest-dev/pytest#12178. --- tests/test_multiprocess.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_multiprocess.py b/tests/test_multiprocess.py index baadb7be..1ffd9ff1 100644 --- a/tests/test_multiprocess.py +++ b/tests/test_multiprocess.py @@ -6,6 +6,16 @@ import keyring +@pytest.fixture(autouse=True) +def workaround_pytest_12178(monkeypatch): + """ + Ensure the current directory is on sys.path so that `tests` is importable. + + Workaround for #673. + """ + monkeypatch.syspath_prepend('.') + + def subprocess_get(): keyring.get_password('test_app', 'test_user')