Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,15 @@ def test_subclass_clear_cla():
# Note, we cannot use mocking here as we want to be sure that the
# superclass fallback does not recurse.

with pytest.warns(match='Overriding `Axes.cla`'):
with pytest.warns(PendingDeprecationWarning,
match='Overriding `Axes.cla`'):
class ClaAxes(Axes):
def cla(self):
nonlocal called
called = True

with pytest.warns(match='Overriding `Axes.cla`'):
with pytest.warns(PendingDeprecationWarning,
match='Overriding `Axes.cla`'):
class ClaSuperAxes(Axes):
def cla(self):
nonlocal called
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_double_register_builtin_cmap():
mpl.colormaps[name], name=name, force=True
)
with pytest.raises(ValueError, match='A colormap named "viridis"'):
with pytest.warns():
with pytest.warns(PendingDeprecationWarning):
cm.register_cmap(name, mpl.colormaps[name])
with pytest.warns(UserWarning):
# TODO is warning more than once!
Expand All @@ -128,7 +128,7 @@ def test_unregister_builtin_cmap():
name = "viridis"
match = f'cannot unregister {name!r} which is a builtin colormap.'
with pytest.raises(ValueError, match=match):
with pytest.warns():
with pytest.warns(PendingDeprecationWarning):
cm.unregister_cmap(name)


Expand Down