Skip to content

Commit

Permalink
changed skip test flag to github actions flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSWDavis committed Feb 19, 2025
1 parent 433b07d commit 1c60130
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pytests/test_anisotropic_MAIRE.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import os
import pytest


IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"

"""
Unit tests for the anisotropic MAIRE module.
"""
Expand Down Expand Up @@ -119,7 +122,7 @@ def test_Common_spec_max_asymp_dir():


@pytest.mark.skipif(
os.getenv("RUN_OPTIONAL_TESTS") == "False",
IN_GITHUB_ACTIONS,
reason="Skipping optional test. Set the environment variable RUN_OPTIONAL_TESTS to run this test."
)
def test_run_from_spectra_two_locations():
Expand Down Expand Up @@ -179,7 +182,7 @@ def test_run_from_spectra_two_locations():
# assert result is not None

@pytest.mark.skipif(
os.getenv("RUN_OPTIONAL_TESTS") == "False",
IN_GITHUB_ACTIONS,
reason="Skipping optional test. Set the environment variable RUN_OPTIONAL_TESTS to run this test."
)
def test_Common_spec_max_asymp_dir():
Expand All @@ -195,7 +198,7 @@ def test_Common_spec_max_asymp_dir():
assert outputted_dose is not None

@pytest.mark.skipif(
os.getenv("RUN_OPTIONAL_TESTS") == "False",
IN_GITHUB_ACTIONS,
reason="Skipping optional test. Set the environment variable RUN_OPTIONAL_TESTS to run this test."
)
def test_DLR_spec():
Expand Down Expand Up @@ -263,7 +266,7 @@ def test_isotropic_dose_rates():
# date_and_time=dt.datetime(2006, 12, 13, 3, 0))

@pytest.mark.skipif(
os.getenv("RUN_OPTIONAL_TESTS") == "False",
IN_GITHUB_ACTIONS,
reason="Skipping optional test. Set the environment variable RUN_OPTIONAL_TESTS to run this test."
)
def test_isotropic_dose_rates():
Expand Down Expand Up @@ -295,7 +298,7 @@ def test_isotropic_dose_rates():
assert rounded_actual_values == expected_isotropic_dose_rates

@pytest.mark.skipif(
os.getenv("RUN_OPTIONAL_TESTS") == "False",
IN_GITHUB_ACTIONS,
reason="Skipping optional test. Set the environment variable RUN_OPTIONAL_TESTS to run this test."
)
def test_anisotropic_dose_rates():
Expand Down

0 comments on commit 1c60130

Please sign in to comment.