From fff130d1a6dd789032be8999607d4b518147d675 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Thu, 30 May 2019 18:07:36 +0100 Subject: [PATCH] TST: update tests\plotting\test_frame.py for mpl 3.1.0 --- pandas/plotting/_compat.py | 1 + pandas/tests/plotting/test_frame.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/plotting/_compat.py b/pandas/plotting/_compat.py index 4077bef8f36f5..36bbe0f4ec174 100644 --- a/pandas/plotting/_compat.py +++ b/pandas/plotting/_compat.py @@ -17,3 +17,4 @@ def inner(): _mpl_ge_2_2_3 = _mpl_version('2.2.3', operator.ge) _mpl_ge_3_0_0 = _mpl_version('3.0.0', operator.ge) +_mpl_ge_3_1_0 = _mpl_version('3.1.0', operator.ge) diff --git a/pandas/tests/plotting/test_frame.py b/pandas/tests/plotting/test_frame.py index aede84ac831a6..f42f86540e46b 100644 --- a/pandas/tests/plotting/test_frame.py +++ b/pandas/tests/plotting/test_frame.py @@ -23,6 +23,7 @@ from pandas.io.formats.printing import pprint_thing import pandas.plotting as plotting +from pandas.plotting._compat import _mpl_ge_3_1_0 @td.skip_if_no_mpl @@ -68,7 +69,11 @@ def test_plot(self): self._check_axes_shape(axes, axes_num=4, layout=(4, 1)) df = DataFrame({'x': [1, 2], 'y': [3, 4]}) - with pytest.raises(AttributeError, match='Unknown property blarg'): + if _mpl_ge_3_1_0(): + msg = "'Line2D' object has no property 'blarg'" + else: + msg = "Unknown property blarg" + with pytest.raises(AttributeError, match=msg): df.plot.line(blarg=True) df = DataFrame(np.random.rand(10, 3),