Skip to content

Commit

Permalink
Merge pull request #2114 from greglucas/testing-xfails
Browse files Browse the repository at this point in the history
Address test failures and remove some xfails
  • Loading branch information
QuLogic authored Dec 14, 2022
2 parents e44fe31 + 5207c3b commit 5221f82
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest'
id: minimum-packages
run: |
echo "PACKAGES=cython=0.29.15 matplotlib-base=3.2.1 numpy=1.19 owslib=0.19.1 pyproj=3.0 scipy=1.4.0 shapely=1.6.4" >> $GITHUB_ENV
echo "PACKAGES=cython=0.29.15 matplotlib-base=3.2.1 numpy=1.19 owslib=0.20.0 pyproj=3.0 scipy=1.4.0 shapely=1.6.4" >> $GITHUB_ENV
- name: Latest packages
if: steps.minimum-packages.conclusion == 'skipped' && !matrix.shapely-dev
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ to install these optional dependencies.
**SciPy** 1.3.1 or later (https://www.scipy.org/)
A Python package for scientific computing.

**OWSLib** 0.18 (https://pypi.python.org/pypi/OWSLib)
**OWSLib** 0.20 or later (https://pypi.python.org/pypi/OWSLib)
A Python package for client programming with the Open Geospatial
Consortium (OGC) web service, and which gives access to Cartopy ogc
clients.
Expand Down
14 changes: 0 additions & 14 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

import cartopy
import matplotlib
import owslib
from packaging.version import parse as parse_version
from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -83,17 +81,6 @@
release = cartopy.__version__


if (hasattr(owslib, '__version__') and
parse_version(owslib.__version__) >= parse_version('0.19.2')):
expected_failing_examples = []
else:
# OWSLib WMTS support is broken.
expected_failing_examples = [
'../../examples/web_services/reprojected_wmts.py',
'../../examples/web_services/wmts.py',
'../../examples/web_services/wmts_time.py',
]

subsection_order = ExplicitOrder(['../../examples/lines_and_polygons',
'../../examples/scalar_data',
'../../examples/vector_data',
Expand All @@ -111,7 +98,6 @@
'doc_module': ('cartopy',),
'reference_url': {'cartopy': None},
'backreferences_dir': '../build/backrefs',
'expected_failing_examples': expected_failing_examples,
'subsection_order': subsection_order,
'matplotlib_animations': True,
}
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- conda-forge/label/testing::matplotlib-base>=3.1

# OWS
- owslib>=0.18.0
- owslib>=0.20.0
- pillow>=6.1.0
# Plotting
- gdal>=2.3.2
Expand Down
4 changes: 3 additions & 1 deletion lib/cartopy/tests/io/test_ogc_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# licensing details.

from unittest import mock
from xml.etree.ElementTree import ParseError

import numpy as np
try:
Expand Down Expand Up @@ -126,7 +127,6 @@ 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(raises=KeyError, reason='OWSLib WMTS support is broken.')
class TestWMTSRasterSource:
URI = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi'
layer_name = 'VIIRS_CityLights_2012'
Expand Down Expand Up @@ -229,6 +229,8 @@ def test_unsupported_projection(self):
with pytest.raises(ValueError, match=msg):
source.fetch_geometries(ccrs.PlateCarree(), [-180, 180, -90, 90])

@pytest.mark.xfail(raises=ParseError,
reason="Bad XML returned from the URL")
def test_fetch_geometries(self):
source = ogc.WFSGeometrySource(self.URI, self.typename)
# Extent covering New Zealand.
Expand Down
1 change: 0 additions & 1 deletion lib/cartopy/tests/mpl/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def test_contourf_transform_path_counting():
@pytest.mark.filterwarnings("ignore:TileMatrixLimits")
@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@pytest.mark.xfail(raises=KeyError, reason='OWSLib WMTS support is broken.')
def test_wmts_tile_caching():
image_cache = WMTSRasterSource._shared_image_cache
image_cache.clear()
Expand Down
3 changes: 3 additions & 0 deletions lib/cartopy/tests/mpl/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This file is part of Cartopy and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
from xml.etree.ElementTree import ParseError

import matplotlib.pyplot as plt
import pytest
Expand Down Expand Up @@ -58,6 +59,8 @@ def test_gshhs():

@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@pytest.mark.xfail(raises=ParseError,
reason="Bad XML returned from the URL")
@pytest.mark.mpl_image_compare(filename='wfs.png')
def test_wfs():
ax = plt.axes(projection=ccrs.OSGB(approx=True))
Expand Down
1 change: 0 additions & 1 deletion lib/cartopy/tests/mpl/test_web_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@pytest.mark.filterwarnings("ignore:TileMatrixLimits")
@pytest.mark.network
@pytest.mark.skipif(not _OWSLIB_AVAILABLE, reason='OWSLib is unavailable.')
@pytest.mark.xfail(raises=KeyError, reason='OWSLib WMTS support is broken.')
@pytest.mark.mpl_image_compare(filename='wmts.png', tolerance=0)
def test_wmts():
ax = plt.axes(projection=ccrs.PlateCarree())
Expand Down
4 changes: 1 addition & 3 deletions lib/cartopy/tests/test_img_nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def world_file_extent(*args, **kwargs):
return extent, pix_size


@pytest.mark.xfail(reason='MapQuest is unavailable')
@pytest.mark.network
def test_nest(nest_from_config):
crs = cimgt.GoogleTiles().crs
Expand Down Expand Up @@ -235,7 +234,7 @@ def test_nest(nest_from_config):
assert ('aerial z1 test', img) in nest_z0_z1._ancestry[key]

x1_y0_z1, = (img for img in z1.images
if img.filename.endswith('z_1/x_1_y_0.png'))
if img.filename.endswith('x_1_y_0.png'))

assert (1, 0, 1) == _tile_from_img(x1_y0_z1)

Expand Down Expand Up @@ -338,7 +337,6 @@ def wmts_data():
img.save(fname)


@pytest.mark.xfail(reason='MapQuest is unavailable')
@pytest.mark.network
def test_find_images(wmts_data):
z2_dir = os.path.join(_TEST_DATA_DIR, 'z_2')
Expand Down
2 changes: 1 addition & 1 deletion requirements/ows.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OWSLib>=0.18.0
OWSLib>=0.20.0
pillow>=6.1.0

0 comments on commit 5221f82

Please sign in to comment.