Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Avoid contour warning for MPL3.8 #2215

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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