Skip to content

Commit

Permalink
MNT: Make cartopy optional in testing. (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman authored Nov 28, 2022
1 parent 7f6250b commit 55c9a16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions act/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
)
from act.utils.data_utils import accumulate_precip

try:
import cartopy
CARTOPY_AVAILABLE = True
except ImportError:
CARTOPY_AVAILABLE = False

matplotlib.use('Agg')


Expand Down Expand Up @@ -378,6 +384,7 @@ def test_xsection_plot():
matplotlib.pyplot.close(xsection.fig)


@pytest.mark.skipif(not CARTOPY_AVAILABLE, reason="Cartopy is not installed.")
@pytest.mark.mpl_image_compare(tolerance=30)
def test_xsection_plot_map():
radar_ds = arm.read_netcdf(sample_files.EXAMPLE_VISST, combine='nested', concat_dim='time')
Expand All @@ -403,6 +410,7 @@ def test_xsection_plot_map():
pass


@pytest.mark.skipif(not CARTOPY_AVAILABLE, reason="Cartopy is not installed.")
@pytest.mark.mpl_image_compare(tolerance=30)
def test_geoplot():
sonde_ds = arm.read_netcdf(sample_files.EXAMPLE_SONDE1)
Expand Down

0 comments on commit 55c9a16

Please sign in to comment.