Skip to content

Commit 4c54dd2

Browse files
simonjayhawkinsTomAugspurger
authored andcommitted
TST: update tests\plotting\test_frame.py for mpl 3.1.0 (#26577)
1 parent 7c8041b commit 4c54dd2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pandas/plotting/_compat.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ def inner():
1717

1818
_mpl_ge_2_2_3 = _mpl_version('2.2.3', operator.ge)
1919
_mpl_ge_3_0_0 = _mpl_version('3.0.0', operator.ge)
20+
_mpl_ge_3_1_0 = _mpl_version('3.1.0', operator.ge)

pandas/tests/plotting/test_frame.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from pandas.io.formats.printing import pprint_thing
2525
import pandas.plotting as plotting
26+
from pandas.plotting._compat import _mpl_ge_3_1_0
2627

2728

2829
@td.skip_if_no_mpl
@@ -68,7 +69,11 @@ def test_plot(self):
6869
self._check_axes_shape(axes, axes_num=4, layout=(4, 1))
6970

7071
df = DataFrame({'x': [1, 2], 'y': [3, 4]})
71-
with pytest.raises(AttributeError, match='Unknown property blarg'):
72+
if _mpl_ge_3_1_0():
73+
msg = "'Line2D' object has no property 'blarg'"
74+
else:
75+
msg = "Unknown property blarg"
76+
with pytest.raises(AttributeError, match=msg):
7277
df.plot.line(blarg=True)
7378

7479
df = DataFrame(np.random.rand(10, 3),

0 commit comments

Comments
 (0)