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

Skip to content

Commit 4c44c02

Browse files
timhoffmStephen-Chilcote
authored andcommitted
Suppress deprecation warning when testing
1 parent 0908956 commit 4c44c02

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5501,8 +5501,14 @@ def test_none_kwargs():
55015501

55025502

55035503
def test_ls_ds_conflict():
5504-
with pytest.raises(ValueError):
5505-
plt.plot(range(32), linestyle='steps-pre:', drawstyle='steps-post')
5504+
with warnings.catch_warnings():
5505+
# Passing the drawstyle with the linestyle is deprecated since 3.1.
5506+
# We still need to test this until it's removed from the code.
5507+
# But we don't want to see the deprecation warning in the test.
5508+
warnings.filterwarnings('ignore',
5509+
category=MatplotlibDeprecationWarning)
5510+
with pytest.raises(ValueError):
5511+
plt.plot(range(32), linestyle='steps-pre:', drawstyle='steps-post')
55065512

55075513

55085514
def test_bar_uint8():

0 commit comments

Comments
 (0)