Skip to content

Commit

Permalink
Merge pull request #2215 from greglucas/tst-contour-warning
Browse files Browse the repository at this point in the history
TST: Avoid contour warning for MPL3.8
  • Loading branch information
greglucas committed Jul 17, 2023
2 parents 312fc23 + 81a932d commit eb3933c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/cartopy/tests/mpl/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from cartopy.mpl.feature_artist import FeatureArtist
import cartopy.mpl.geoaxes as cgeoaxes
import cartopy.mpl.patch
from cartopy.tests.mpl import MPL_VERSION


def sample_data(shape=(73, 145)):
Expand Down Expand Up @@ -120,7 +121,11 @@ def test_contourf_transform_path_counting():
with mock.patch('cartopy.mpl.patch.path_to_geos') as path_to_geos_counter:
x, y, z = sample_data((30, 60))
cs = ax.contourf(x, y, z, 5, transform=ccrs.PlateCarree())
n_geom = sum(len(c.get_paths()) for c in cs.collections)
if MPL_VERSION.release[:2] < (3, 8):
n_geom = sum(len(c.get_paths()) for c in cs.collections)
else:
n_geom = len(cs.get_paths())

del cs
fig.canvas.draw()

Expand Down

0 comments on commit eb3933c

Please sign in to comment.