Skip to content

Commit

Permalink
test: Only run pythia8 tests if enabled (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger authored Dec 14, 2022
1 parent d4aac95 commit 0aa3259
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Examples/Python/tests/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
except ImportError:
edm4hepEnabled = False


try:
import acts.examples

pythia8Enabled = hasattr(acts.examples, "pythia8")
except ImportError:
pythia8Enabled = False

isCI = os.environ.get("CI", "false") == "true"


Expand Down
3 changes: 3 additions & 0 deletions Examples/Python/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
rootEnabled,
dd4hepEnabled,
hepmc3Enabled,
pythia8Enabled,
AssertCollectionExistsAlg,
isCI,
doHashChecks,
Expand Down Expand Up @@ -65,6 +66,7 @@ def assert_entries(root_file, tree_name, exp):


@pytest.mark.slow
@pytest.mark.skipif(not pythia8Enabled, reason="Pythia8 not set up")
def test_pythia8(tmp_path, seq, assert_root_hash):
from pythia8 import runPythia8

Expand Down Expand Up @@ -1091,6 +1093,7 @@ def test_ckf_tracks_example(


@pytest.mark.skipif(not dd4hepEnabled, reason="DD4hep not set up")
@pytest.mark.skipif(not pythia8Enabled, reason="Pythia8 not set up")
@pytest.mark.slow
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_vertex_fitting(tmp_path):
Expand Down

0 comments on commit 0aa3259

Please sign in to comment.