1010
1111tutorial_dir = pathlib .Path (str (ROOT .gROOT .GetTutorialDir ()))
1212
13+ subdirs = [
14+ "analysis/dataframe" ,
15+ "analysis/tree" ,
16+ "hist" ,
17+ "io/ntuple" ,
18+ "roofit/roofit"
19+ ]
20+
1321# ----------------------
1422# Python tutorials tests
1523# ----------------------
16- py_tutorials = list (tutorial_dir .rglob ("*.py" ))
24+ py_tutorials = []
25+ for sub in subdirs :
26+ sub_path = tutorial_dir / sub
27+ py_tutorials .extend (sub_path .rglob ("*.py" ))
1728
1829def test_tutorials_are_detected ():
1930 assert len (py_tutorials ) > 0
@@ -43,15 +54,16 @@ def test_tutorial(tutorial):
4354# ----------------------
4455# C++ tutorials tests
4556# ----------------------
46- cpp_tutorials = list (tutorial_dir .rglob ("*.C" ))
57+ cpp_tutorials = []
58+ for sub in subdirs :
59+ sub_path = tutorial_dir / sub
60+ cpp_tutorials .extend (sub_path .rglob ("*.C" ))
4761
4862def test_cpp_tutorials_are_detected ():
4963 assert len (cpp_tutorials ) > 0
5064
5165@pytest .mark .parametrize ("tutorial" , cpp_tutorials , ids = lambda p : p .name )
5266def test_cpp_tutorial (tutorial ):
53- # ROOT.gROOT.ProcessLine(f".x {tutorial}")
54-
5567 try :
5668 result = subprocess .run (
5769 [sys .executable , "-c" , f'import ROOT; ROOT.gROOT.ProcessLine(".x { tutorial } ")' ],
@@ -64,7 +76,7 @@ def test_cpp_tutorial(tutorial):
6476 pytest .skip (f"Tutorial { tutorial } timed out" )
6577 except subprocess .CalledProcessError as e :
6678 if e .returncode == - signal .SIGILL or e .returncode == 132 :
67- pytest .skip (f"Skipping { tutorial .name } (illegal instruction on this platform)" )
79+ pytest .fail (f"Failing { tutorial .name } (illegal instruction on this platform)" )
6880 elif "EOFError" in e .stderr :
6981 pytest .skip (f"Skipping { tutorial .name } (requires user input)" )
7082 raise
0 commit comments