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

Skip to content

Commit d79202f

Browse files
committed
TST: change from pytest xfail to pytest raises
Passing origin as a keyword argument should raise a type error, so test_specgram_origin_kwarg should raise an exception. Therefore, raises is a more precise check than xfail.
1 parent 3f06646 commit d79202f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,13 +4117,13 @@ def test_specgram_origin_rcparam(fig_test, fig_ref):
41174117
fig_test.subplots().specgram(signal)
41184118

41194119

4120-
@pytest.mark.xfail(strict=True)
41214120
def test_specgram_origin_kwarg():
4122-
"""Ensure passing origin as a kwarg raises an exception."""
4121+
"""Ensure passing origin as a kwarg raises a TypeError."""
41234122
t = np.arange(500)
41244123
signal = np.sin(t)
41254124

4126-
plt.specgram(signal, origin='lower')
4125+
with pytest.raises(TypeError):
4126+
plt.specgram(signal, origin='lower')
41274127

41284128

41294129
@image_comparison(

0 commit comments

Comments
 (0)