Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8d1906

Browse filesBrowse files
committed
Catch a few test warnings
1 parent 230a251 commit e8d1906
Copy full SHA for e8d1906

File tree

Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,8 @@ def test_pyplot_axes():
18211821
# test focusing of Axes in other Figure
18221822
fig1, ax1 = plt.subplots()
18231823
fig2, ax2 = plt.subplots()
1824-
assert ax1 is plt.axes(ax1)
1824+
with pytest.warns(MatplotlibDeprecationWarning):
1825+
assert ax1 is plt.axes(ax1)
18251826
assert ax1 is plt.gca()
18261827
assert fig1 is plt.gcf()
18271828
plt.close(fig1)

‎lib/matplotlib/tests/test_dates.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_dates.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from matplotlib.testing.decorators import image_comparison
1111
import matplotlib.pyplot as plt
12+
from matplotlib.cbook import MatplotlibDeprecationWarning
1213
import matplotlib.dates as mdates
1314

1415

@@ -239,16 +240,18 @@ def test_strftime_fields(dt):
239240
minute=dt.minute,
240241
second=dt.second,
241242
microsecond=dt.microsecond))
242-
assert formatter.strftime(dt) == formatted_date_str
243+
with pytest.warns(MatplotlibDeprecationWarning):
244+
assert formatter.strftime(dt) == formatted_date_str
243245

244246
try:
245247
# Test strftime("%x") with the current locale.
246248
import locale # Might not exist on some platforms, such as Windows
247249
locale_formatter = mdates.DateFormatter("%x")
248250
locale_d_fmt = locale.nl_langinfo(locale.D_FMT)
249251
expanded_formatter = mdates.DateFormatter(locale_d_fmt)
250-
assert locale_formatter.strftime(dt) == \
251-
expanded_formatter.strftime(dt)
252+
with pytest.warns(MatplotlibDeprecationWarning):
253+
assert locale_formatter.strftime(dt) == \
254+
expanded_formatter.strftime(dt)
252255
except (ImportError, AttributeError):
253256
pass
254257

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.