Skip to content

Commit 0aa60e5

Browse files
committed
[build] Run hsimple.py tutorial first to produce needed file
hist015_TH1_read_and_draw.py and hist015_TH1_read_and_draw_uhi.py need py-hsimple.root produced by hsimple.py, so run that first when testing the wheel. Also explicitly specify cwd argument to subprocess.open, so that the other tutorials can find the required file.
1 parent 26d88d2 commit 0aa60e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/wheels/test_tutorials.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
# ----------------------
3131
# Python tutorials tests
3232
# ----------------------
33-
py_tutorials = []
33+
# Prepend hsimple.py to execute it first, hist015_TH1_read_and_draw.py and hist015_TH1_read_and_draw_uhi.py need the
34+
# file produced by this tutorial
35+
py_tutorials = [tutorial_dir / "hsimple.py"]
3436
for sub in subdirs:
3537
sub_path = tutorial_dir / sub
3638
for f in sub_path.rglob("*.py"):
@@ -60,6 +62,7 @@ def test_tutorial(tutorial):
6062
timeout=60,
6163
capture_output=True,
6264
text=True,
65+
cwd=tutorial_dir
6366
)
6467
print("Test stderr:", result.stderr)
6568

@@ -102,6 +105,7 @@ def test_cpp_tutorial(tutorial):
102105
timeout=60,
103106
capture_output=True,
104107
text=True,
108+
cwd=tutorial_dir
105109
)
106110
print("Test stderr:", result.stderr)
107111

0 commit comments

Comments
 (0)