Skip to content

Commit

Permalink
🧪 Add failing test case showing the error
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed Nov 6, 2021
1 parent 1ecf91a commit d058db9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,13 @@ def test_slice_in_title(self):
title = plt.gca().get_title()
assert "d = 10.01" == title

def test_slice_in_title_single_item_array(self):
"""Edge case for data of shape (1, N) or (N, 1)."""
darray = self.darray.expand_dims({"d": np.array([10.009])})
darray.plot.line(x="period")
title = plt.gca().get_title()
assert "d = 10.01" == title


class TestPlotStep(PlotTestCase):
@pytest.fixture(autouse=True)
Expand Down

0 comments on commit d058db9

Please sign in to comment.