From b48e406313da03e073a21fc0b2fcfa00f9698344 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Sat, 7 Oct 2023 09:32:11 -0600 Subject: [PATCH] MNT: xfail owslib tests and documentation that use NASA This adds xfails to the NASA server requests that are failing due to upstream issues that we can't control. This can be reverted if/when NASA or owslib update their codebases. --- docs/source/conf.py | 6 ++++++ lib/cartopy/tests/io/test_ogc_clients.py | 1 + lib/cartopy/tests/mpl/test_caching.py | 1 + lib/cartopy/tests/mpl/test_web_services.py | 1 + 4 files changed, 9 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2a5b8fe27..f6b1daef9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -92,6 +92,12 @@ sphinx_gallery_conf = { 'capture_repr': (), 'examples_dirs': ['../../examples'], + # NASA wmts servers are returning bad content metadata + "expected_failing_examples": [ + '../../examples/web_services/reprojected_wmts.py', + '../../examples/web_services/wmts.py', + '../../examples/web_services/wmts_time.py', + ], 'filename_pattern': '^((?!sgskip).)*$', 'gallery_dirs': ['gallery'], 'within_subsection_order': ExampleTitleSortKey, diff --git a/lib/cartopy/tests/io/test_ogc_clients.py b/lib/cartopy/tests/io/test_ogc_clients.py index cf60eef07..87a9a77a7 100644 --- a/lib/cartopy/tests/io/test_ogc_clients.py +++ b/lib/cartopy/tests/io/test_ogc_clients.py @@ -135,6 +135,7 @@ def test_float_resolution(self): @pytest.mark.filterwarnings("ignore:TileMatrixLimits") @pytest.mark.network @pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.') +@pytest.mark.xfail(reason='NASA servers are returning bad content metadata') class TestWMTSRasterSource: URI = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi' layer_name = 'VIIRS_CityLights_2012' diff --git a/lib/cartopy/tests/mpl/test_caching.py b/lib/cartopy/tests/mpl/test_caching.py index 9cb881355..6ca00b163 100644 --- a/lib/cartopy/tests/mpl/test_caching.py +++ b/lib/cartopy/tests/mpl/test_caching.py @@ -155,6 +155,7 @@ def test_contourf_transform_path_counting(): @pytest.mark.network @pytest.mark.skipif(not _HAS_PYKDTREE_OR_SCIPY or not _OWSLIB_AVAILABLE, reason='OWSLib and at least one of pykdtree or scipy is required') +@pytest.mark.xfail(reason='NASA servers are returning bad content metadata') def test_wmts_tile_caching(): image_cache = WMTSRasterSource._shared_image_cache image_cache.clear() diff --git a/lib/cartopy/tests/mpl/test_web_services.py b/lib/cartopy/tests/mpl/test_web_services.py index d720b1f1d..b6fed16dc 100644 --- a/lib/cartopy/tests/mpl/test_web_services.py +++ b/lib/cartopy/tests/mpl/test_web_services.py @@ -21,6 +21,7 @@ @pytest.mark.network @pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.') @pytest.mark.mpl_image_compare(filename='wmts.png', tolerance=0.03) +@pytest.mark.xfail(reason='NASA servers are returning bad content metadata') def test_wmts(): ax = plt.axes(projection=ccrs.PlateCarree()) url = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi'