Skip to content

Commit c916f5d

Browse files
authored
Update test to include PYTHONPATH environment variable
1 parent 9a5f1f6 commit c916f5d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
def test_benchmark_runs():
66
"""Check that the benchmark script runs without errors."""
77

8-
# Path to the benchmark script (update if needed)
98
benchmark_path = os.path.join(
109
os.path.dirname(__file__),
1110
"..", "ex", "benchmarks-deterministic", "PRoTECT-versions", "ex1_dt_DS.py"
1211
)
1312

14-
# Verify the file exists before running
1513
assert os.path.exists(benchmark_path), f"Benchmark script not found: {benchmark_path}"
1614

15+
env = os.environ.copy()
16+
env["PYTHONPATH"] = os.path.join(os.path.dirname(__file__), "..")
17+
1718
result = subprocess.run(
1819
[sys.executable, benchmark_path],
1920
capture_output=True,
20-
text=True
21+
text=True,
22+
env=env
2123
)
2224

23-
# Assert successful exit
2425
assert result.returncode == 0, f"Benchmark failed with error:\n{result.stderr}"

0 commit comments

Comments
 (0)