|
2 | 2 | import pytest |
3 | 3 | import numpy as np |
4 | 4 |
|
| 5 | +from matplotlib._api import MatplotlibDeprecationWarning |
5 | 6 | from matplotlib.axes import Axes |
6 | 7 | import matplotlib.pyplot as plt |
7 | 8 | import matplotlib.category as cat |
@@ -100,12 +101,14 @@ def test_convert_one_string(self, value): |
100 | 101 | assert self.cc.convert(value, self.unit, self.ax) == 0 |
101 | 102 |
|
102 | 103 | def test_convert_one_number(self): |
103 | | - actual = self.cc.convert(0.0, self.unit, self.ax) |
| 104 | + with pytest.warns(MatplotlibDeprecationWarning): |
| 105 | + actual = self.cc.convert(0.0, self.unit, self.ax) |
104 | 106 | np.testing.assert_allclose(actual, np.array([0.])) |
105 | 107 |
|
106 | 108 | def test_convert_float_array(self): |
107 | 109 | data = np.array([1, 2, 3], dtype=float) |
108 | | - actual = self.cc.convert(data, self.unit, self.ax) |
| 110 | + with pytest.warns(MatplotlibDeprecationWarning): |
| 111 | + actual = self.cc.convert(data, self.unit, self.ax) |
109 | 112 | np.testing.assert_allclose(actual, np.array([1., 2., 3.])) |
110 | 113 |
|
111 | 114 | @pytest.mark.parametrize("fvals", fvalues, ids=fids) |
|
0 commit comments