diff --git a/xrspatial/geotiff/tests/conftest.py b/xrspatial/geotiff/tests/conftest.py index 394d368a..86cf2a26 100644 --- a/xrspatial/geotiff/tests/conftest.py +++ b/xrspatial/geotiff/tests/conftest.py @@ -3,6 +3,7 @@ import importlib.util import math +import os import socket import struct @@ -54,6 +55,14 @@ def loopback_available() -> bool: not _HAS_LOOPBACK, reason="loopback bind unavailable in this environment" ) +_RUN_INTEGRATION = os.environ.get("XRSPATIAL_RUN_INTEGRATION", "") not in ( + "", "0", "false", "False" +) +requires_integration = pytest.mark.skipif( + not _RUN_INTEGRATION, + reason="integration test; set XRSPATIAL_RUN_INTEGRATION=1 to run locally", +) + def pytest_collection_modifyitems(config, items): """Auto-skip tests that stand up a loopback HTTP server when the diff --git a/xrspatial/geotiff/tests/test_int_coords_round_trip_hotfix_1962.py b/xrspatial/geotiff/tests/test_int_coords_round_trip_hotfix_1962.py index e7fca446..4945c09e 100644 --- a/xrspatial/geotiff/tests/test_int_coords_round_trip_hotfix_1962.py +++ b/xrspatial/geotiff/tests/test_int_coords_round_trip_hotfix_1962.py @@ -16,11 +16,14 @@ from xrspatial.geotiff import open_geotiff, to_geotiff +from .conftest import requires_integration + def _tmp_path(name): return os.path.join(tempfile.gettempdir(), name) +@requires_integration class TestIntCoordRoundTripHotfix1962: def test_int_coords_2d_round_trip(self): pixels = np.arange(20, dtype=np.float32).reshape(4, 5)