Skip to content

Commit e99be22

Browse files
authored
Merge pull request #12919 from timhoffm/test-suppress-deprecation-warning
Suppress deprecation warning when testing drawstyle conflict
2 parents 2507f2c + 5bd4618 commit e99be22

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/tests/test_axes.py

+8-2
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)