From 31ed633ff3620e1ab424d3d14f3747e3a4adaeae Mon Sep 17 00:00:00 2001 From: Mike Boyle Date: Thu, 12 Sep 2024 12:56:19 -0400 Subject: [PATCH] Skip downloads on macOS for github actions --- tests/conftest.py | 11 +++++++++++ tests/test_simulation.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 9ce1b009..9fddf7b9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,6 +20,17 @@ except: requires_sympy = pytest.mark.skip(reason="sympy is missing") +GITHUB_ACTIONS_MACOS = ( + os.getenv("GITHUB_ACTIONS", "") == "true" + and os.getenv("RUNNER_OS", "") == "macOS" +) + +if GITHUB_ACTIONS_MACOS: + skip_macOS_GH_actions_downloads = pytest.mark.skip( + reason="macOS runners on GitHub Actions have connectivity problems" + ) +else: + skip_macOS_GH_actions_downloads = lambda f: f def pytest_addoption(parser): diff --git a/tests/test_simulation.py b/tests/test_simulation.py index 9dd07f4e..092c018e 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -1,5 +1,6 @@ import pytest import sxs +from .conftest import skip_macOS_GH_actions_downloads def test_sxs_load_v2(): @@ -10,6 +11,7 @@ def test_sxs_load_v2(): s.horizons +@skip_macOS_GH_actions_downloads @pytest.mark.parametrize("loader", [sxs.Simulation, sxs.load]) def test_superseded_by_single(loader): simulation = "SXS:BBH:0001" @@ -38,6 +40,7 @@ def test_superseded_by_single(loader): assert s.sxs_id_stem == simulation +@skip_macOS_GH_actions_downloads @pytest.mark.parametrize("loader", [sxs.Simulation, sxs.load]) def test_superseded_by_multiple(loader): simulation = "SXS:BBH:0030"