Skip to content

Commit

Permalink
Skip downloads on macOS for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Sep 12, 2024
1 parent ce8188e commit 31ed633
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_simulation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import sxs
from .conftest import skip_macOS_GH_actions_downloads


def test_sxs_load_v2():
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 31ed633

Please sign in to comment.