From add54d5791ba968eeae13c9d4005914719addbce Mon Sep 17 00:00:00 2001 From: zmoon Date: Mon, 7 Oct 2024 15:38:58 -0500 Subject: [PATCH] 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")