Skip to content

Commit 7840328

Browse files
committed
Add test for deprecation warning
1 parent 59899c9 commit 7840328

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from numpy import ma
1515
from numpy import arange
1616

17+
import warnings
18+
1719
import matplotlib
1820
from matplotlib.testing.decorators import image_comparison, cleanup
1921
import matplotlib.pyplot as plt
@@ -4088,6 +4090,17 @@ def test_violin_point_mass():
40884090
"""Violin plot should handle point mass pdf gracefully."""
40894091
plt.violinplot(np.array([0, 0]))
40904092

4093+
4094+
@cleanup
4095+
def test_axisbg_warning():
4096+
fig = plt.figure()
4097+
with warnings.catch_warnings(record=True) as w:
4098+
ax = matplotlib.axes.Axes(fig, [0, 0, 1, 1], axisbg='r')
4099+
assert len(w) == 1
4100+
assert (str(w[0].message).startswith(
4101+
("The axisbg attribute was deprecated in version 2.0.")))
4102+
4103+
40914104
if __name__ == '__main__':
40924105
import nose
40934106
import sys

0 commit comments

Comments
 (0)