From 902f982c521bc5afe826db04216280bc832411d4 Mon Sep 17 00:00:00 2001 From: David Gilman Date: Thu, 24 Aug 2023 17:14:18 -0400 Subject: [PATCH] CLI flag for testing shapefile URLs --- us/tests/conftest.py | 7 +++++++ us/tests/test_us.py | 1 + 2 files changed, 8 insertions(+) diff --git a/us/tests/conftest.py b/us/tests/conftest.py index 7f42f19..e6fbf7e 100644 --- a/us/tests/conftest.py +++ b/us/tests/conftest.py @@ -13,3 +13,10 @@ def pytest_addoption(parser): default=False, help="enable DC statehood tests (you must export DC_STATEHOOD envvar)", ) + parser.addoption( + "--shapefile-urls", + action="store_true", + dest="shapefile_urls", + default=False, + help="test for existence of shapefile URLs on census server" + ) diff --git a/us/tests/test_us.py b/us/tests/test_us.py index 588eb04..4f8b838 100644 --- a/us/tests/test_us.py +++ b/us/tests/test_us.py @@ -163,6 +163,7 @@ def test_cache(): ] +@pytest.mark.skipif("not config.getoption('shapefile_urls')") @pytest.mark.parametrize("url", shapefile_urls) def test_shapefiles_head(url): import requests