From f4221f0a34b6999cd6ab8e30554b36dee1f8c1a2 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Sun, 23 Jun 2024 20:26:57 -0700 Subject: [PATCH] Add test for #9155 I can't get this to fail locally, so adding a test to assess what's going on. Alos excludes matplotlib from type exclusions --- pyproject.toml | 1 - xarray/tests/test_plot.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index db64d7a18c5..e836c7c3e53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,7 +115,6 @@ module = [ "h5netcdf.*", "h5py.*", "iris.*", - "matplotlib.*", "mpl_toolkits.*", "nc_time_axis.*", "numbagg.*", diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index a44b621a981..4c46f10c11d 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -3406,3 +3406,11 @@ def test_plot1d_filtered_nulls() -> None: actual = pc.get_offsets().shape[0] assert expected == actual + +@requires_matplotlib +def test_9155() -> None: + # A test for types from issue #9155 + + data = xr.DataArray([1, 2, 3], dims=["x"]) + fig, ax = plt.subplots(ncols=1, nrows=1) + data.plot(ax=ax)