Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 372d5d8

Browse files
authored
Merge pull request #9975 from dstansby/test-warnings
Remove some test warnings
2 parents dfc3a79 + 249b00f commit 372d5d8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6158,14 +6158,14 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61586158
if histtype == 'barstacked' and not stacked:
61596159
stacked = True
61606160

6161-
if normed is not None:
6162-
warnings.warn("The 'normed' kwarg is deprecated, and has been "
6163-
"replaced by the 'density' kwarg.")
61646161
if density is not None and normed is not None:
61656162
raise ValueError("kwargs 'density' and 'normed' cannot be used "
61666163
"simultaneously. "
61676164
"Please only use 'density', since 'normed'"
61686165
"is deprecated.")
6166+
if normed is not None:
6167+
warnings.warn("The 'normed' kwarg is deprecated, and has been "
6168+
"replaced by the 'density' kwarg.")
61696169

61706170
# basic input validation
61716171
input_empty = np.size(x) == 0

lib/matplotlib/tests/test_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,8 @@ def test_pcolorargs():
11971197
x[0] = np.NaN
11981198
with pytest.raises(ValueError):
11991199
ax.pcolormesh(x, y, Z[:-1, :-1])
1200-
x = np.ma.array(x, mask=(x < 0))
1200+
with np.errstate(invalid='ignore'):
1201+
x = np.ma.array(x, mask=(x < 0))
12011202
with pytest.raises(ValueError):
12021203
ax.pcolormesh(x, y, Z[:-1, :-1])
12031204

0 commit comments

Comments
 (0)