diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8eb05616..e3faa6f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: python -c "import monet; print('monet.__version__', getattr(monet, '__version__', '?'))" - name: pytest - run: python -m pytest -v melodies_monet + run: python -m pytest -v -rsx melodies_monet - name: Run docs/examples notebooks as scripts run: | diff --git a/docs/conf.py b/docs/conf.py index ec21e2a8..b07c88a1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -198,6 +198,8 @@ "https://www2.cisl.ucar.edu/resources/conda-environments", # Sphinx 4.5 linkcheck having problem: "https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account", + # NCEI sites having problems + "https://www.ncdc.noaa.gov/crn/", ] user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0" diff --git a/melodies_monet/tests/test_get_data_cli.py b/melodies_monet/tests/test_get_data_cli.py index a61289d5..3cd6c3e5 100644 --- a/melodies_monet/tests/test_get_data_cli.py +++ b/melodies_monet/tests/test_get_data_cli.py @@ -7,10 +7,26 @@ import subprocess import numpy as np +import pytest +import requests import xarray as xr from melodies_monet.tutorial import fetch_example +try: + requests.head("https://www1.ncdc.noaa.gov/pub/data/noaa/") +except Exception: + ish_reachable = False +else: + ish_reachable = True + +try: + requests.head("https://www1.ncdc.noaa.gov/pub/data/noaa/isd-lite/") +except Exception: + ish_lite_reachable = False +else: + ish_lite_reachable = True + ds0_aeronet = xr.open_dataset(fetch_example("aeronet:2019-09")) ds0_airnow = xr.open_dataset(fetch_example("airnow:2019-09")) @@ -84,6 +100,7 @@ def test_get_airnow_comp(tmp_path): assert (np.abs(ds[vn] - ds0[vn]).to_series().dropna() < 3e-7).all() +@pytest.mark.xfail(not ish_lite_reachable, reason="data not reachable") def test_get_ish_lite_box(tmp_path): fn = "x.nc" cmd = [ @@ -100,6 +117,7 @@ def test_get_ish_lite_box(tmp_path): assert np.unique(ds.state) == ["CO"] +@pytest.mark.xfail(not ish_reachable, reason="data not reachable") def test_get_ish_box(tmp_path): fn = "x.nc" cmd = [