Skip to content

Commit d63ea65

Browse files
committed
chore(deps): update pytest to 8.*
Signed-off-by: Charles Moore <122481442+moorec-aws@users.noreply.github.com>
1 parent b1f1351 commit d63ea65

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
import os
4+
import sys
5+
from pathlib import Path
6+
7+
8+
# This ensures test modules can be imported in subprocesses
9+
def pytest_configure(config):
10+
test_path = Path(__file__).parent / "test" / "openjd" / "adaptor_runtime" / "integ"
11+
if test_path.exists():
12+
sys.path.append(str(test_path))
13+
os.environ["PYTHONPATH"] = os.pathsep.join(
14+
[os.environ.get("PYTHONPATH", ""), str(test_path)]
15+
).strip(os.pathsep)

requirements-testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
coverage[toml] == 7.*
22
coverage-conditional-plugin == 0.9.0
3-
pytest == 7.4.*
3+
pytest == 8.3.*
44
pytest-cov == 6.1.*
55
pytest-timeout == 2.4.*
66
pytest-xdist == 3.6.*

test/openjd/adaptor_runtime/integ/background/test_background_mode.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@
2929

3030
mod_path = (Path(__file__).parent.parent).resolve()
3131
sys.path.append(str(mod_path))
32+
3233
if (_pypath := os.environ.get("PYTHONPATH")) is not None:
3334
os.environ["PYTHONPATH"] = os.pathsep.join((_pypath, str(mod_path)))
3435
else:
3536
os.environ["PYTHONPATH"] = str(mod_path)
37+
38+
# Add the module path to PYTHONPATH for subprocesses
39+
os.environ["PYTEST_XDIST_WORKER_PYTHONPATH"] = str(mod_path)
40+
3641
from AdaptorExample import AdaptorExample # noqa: E402
3742

3843

test/openjd/adaptor_runtime/integ/test_integration_entrypoint.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@
2020

2121
mod_path = Path(__file__).parent.resolve()
2222
sys.path.append(str(mod_path))
23+
24+
path_sep = ";" if sys.platform == "win32" else ":"
2325
if (_pypath := os.environ.get("PYTHONPATH")) is not None:
24-
os.environ["PYTHONPATH"] = ":".join((_pypath, str(mod_path)))
26+
os.environ["PYTHONPATH"] = path_sep.join([_pypath, str(mod_path)])
2527
else:
2628
os.environ["PYTHONPATH"] = str(mod_path)
29+
30+
# Add the module path to PYTHONPATH for subprocesses
31+
os.environ["PYTEST_XDIST_WORKER_PYTHONPATH"] = str(mod_path)
32+
2733
from CommandAdaptorExample import CommandAdaptorExample # noqa: E402
2834

2935

0 commit comments

Comments
 (0)