From 1c601300d1648ff65d5696c64956c0a991b8aa67 Mon Sep 17 00:00:00 2001 From: "Chris S. W. Davis" Date: Wed, 19 Feb 2025 17:12:36 +0000 Subject: [PATCH] changed skip test flag to github actions flag --- pytests/test_anisotropic_MAIRE.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pytests/test_anisotropic_MAIRE.py b/pytests/test_anisotropic_MAIRE.py index ba20e95..ec0976e 100644 --- a/pytests/test_anisotropic_MAIRE.py +++ b/pytests/test_anisotropic_MAIRE.py @@ -6,6 +6,9 @@ import os import pytest + +IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" + """ Unit tests for the anisotropic MAIRE module. """ @@ -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(): @@ -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(): @@ -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(): @@ -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(): @@ -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():