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

Skip to content

Commit 5bd4618

Browse files
committed
Suppress deprecation warning when testing
1 parent 898fbaa commit 5bd4618

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/matplotlib/tests/test_axes.py

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

54855485

54865486
def test_ls_ds_conflict():
5487-
with pytest.raises(ValueError):
5488-
plt.plot(range(32), linestyle='steps-pre:', drawstyle='steps-post')
5487+
with warnings.catch_warnings():
5488+
# Passing the drawstyle with the linestyle is deprecated since 3.1.
5489+
# We still need to test this until it's removed from the code.
5490+
# But we don't want to see the deprecation warning in the test.
5491+
warnings.filterwarnings('ignore',
5492+
category=MatplotlibDeprecationWarning)
5493+
with pytest.raises(ValueError):
5494+
plt.plot(range(32), linestyle='steps-pre:', drawstyle='steps-post')
54895495

54905496

54915497
def test_bar_uint8():

0 commit comments

Comments
 (0)