From 4d32de6fbfeeca8d22fe41619c1fc49528fc9851 Mon Sep 17 00:00:00 2001 From: zmoon Date: Mon, 7 Oct 2024 15:40:27 -0500 Subject: [PATCH 1/4] Skip ISH if root pages unreachable --- tests/test_ish.py | 7 +++++++ tests/test_ish_lite.py | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/test_ish.py b/tests/test_ish.py index 4461cd82..80984fbd 100644 --- a/tests/test_ish.py +++ b/tests/test_ish.py @@ -6,6 +6,13 @@ from monetio import ish +try: + import requests + + requests.head("https://www1.ncdc.noaa.gov/pub/data/noaa/") +except Exception: + pytest.skip("NCEI server issues", allow_module_level=True) + def test_ish_read_history(): dates = pd.date_range("2020-09-01", "2020-09-02") diff --git a/tests/test_ish_lite.py b/tests/test_ish_lite.py index 94e9e75f..31aa4a24 100644 --- a/tests/test_ish_lite.py +++ b/tests/test_ish_lite.py @@ -3,6 +3,14 @@ from monetio import ish_lite +try: + import requests + + r = requests.head("https://www1.ncdc.noaa.gov/pub/data/noaa/isd-lite/") + r.raise_for_status() +except Exception: + pytest.skip("NCEI server issues", allow_module_level=True) + def test_ish_read_history(): dates = pd.date_range("2020-09-01", "2020-09-02") From 620096c8b09b4934d0e8d94c5cb11e5334507857 Mon Sep 17 00:00:00 2001 From: zmoon Date: Mon, 7 Oct 2024 16:00:40 -0500 Subject: [PATCH 2/4] aioitertools 0.12.0 dropped 3.6 support https://github.com/omnilib/aioitertools/blob/main/CHANGELOG.md#v0120 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eacb69d..bb3f69ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: create-args: >- python=${{ matrix.python-version }} attrs=22.2.0 + aioitertools=0.11.0 - name: Test with pytest run: pytest -n auto -v -W "ignore:Downloading test file:UserWarning::" From ff75d0bb342f8799aacfa3dfe6b12ab8f2191432 Mon Sep 17 00:00:00 2001 From: Zachary Moon Date: Mon, 7 Oct 2024 17:22:24 -0400 Subject: [PATCH 3/4] Don't need raise-for-status --- tests/test_ish_lite.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_ish_lite.py b/tests/test_ish_lite.py index 31aa4a24..0b110ddd 100644 --- a/tests/test_ish_lite.py +++ b/tests/test_ish_lite.py @@ -7,7 +7,6 @@ import requests r = requests.head("https://www1.ncdc.noaa.gov/pub/data/noaa/isd-lite/") - r.raise_for_status() except Exception: pytest.skip("NCEI server issues", allow_module_level=True) From 03f23a14feb43d2cf2b36139569fb7591db47ba6 Mon Sep 17 00:00:00 2001 From: zmoon Date: Mon, 7 Oct 2024 16:30:49 -0500 Subject: [PATCH 4/4] Show info about skipped and xfailed tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb3f69ee..848d038e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,12 +48,12 @@ jobs: aioitertools=0.11.0 - name: Test with pytest - run: pytest -n auto -v -W "ignore:Downloading test file:UserWarning::" + run: pytest -n auto -v -rsx -W "ignore:Downloading test file:UserWarning::" - name: Test with pytspack installed run: | pip install https://github.com/noaa-oar-arl/pytspack/archive/master.zip - pytest -n auto -v -k with_pytspack + pytest -n auto -v -rsx -k with_pytspack docs: name: Check docs build