Skip to content

Commit

Permalink
TST/FIX: Test for instance rather than string in class representation
Browse files Browse the repository at this point in the history
Matplotlib has merged SubplotBase into AxesBase now, which makes the
class string representation here GeoAxes now, even though we are
still an _instance_ of GeoAxesSubplot
  • Loading branch information
greglucas committed Jan 26, 2023
1 parent a8f62ba commit 42be528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cartopy/tests/mpl/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.geoaxes import InterProjectionTransform, GeoAxes
from cartopy.mpl.geoaxes import InterProjectionTransform, GeoAxes, GeoAxesSubplot


class TestNoSpherical:
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_single_geometry(self):

def test_geoaxes_subplot():
ax = plt.subplot(1, 1, 1, projection=ccrs.PlateCarree())
assert str(ax.__class__) == "<class 'cartopy.mpl.geoaxes.GeoAxesSubplot'>"
assert isinstance(ax, GeoAxesSubplot)


@pytest.mark.mpl_image_compare(filename='geoaxes_subslice.png')
Expand Down

0 comments on commit 42be528

Please sign in to comment.