File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1821,7 +1821,8 @@ def test_pyplot_axes():
1821
1821
# test focusing of Axes in other Figure
1822
1822
fig1 , ax1 = plt .subplots ()
1823
1823
fig2 , ax2 = plt .subplots ()
1824
- assert ax1 is plt .axes (ax1 )
1824
+ with pytest .warns (MatplotlibDeprecationWarning ):
1825
+ assert ax1 is plt .axes (ax1 )
1825
1826
assert ax1 is plt .gca ()
1826
1827
assert fig1 is plt .gcf ()
1827
1828
plt .close (fig1 )
Original file line number Diff line number Diff line change 9
9
10
10
from matplotlib .testing .decorators import image_comparison
11
11
import matplotlib .pyplot as plt
12
+ from matplotlib .cbook import MatplotlibDeprecationWarning
12
13
import matplotlib .dates as mdates
13
14
14
15
@@ -239,16 +240,18 @@ def test_strftime_fields(dt):
239
240
minute = dt .minute ,
240
241
second = dt .second ,
241
242
microsecond = dt .microsecond ))
242
- assert formatter .strftime (dt ) == formatted_date_str
243
+ with pytest .warns (MatplotlibDeprecationWarning ):
244
+ assert formatter .strftime (dt ) == formatted_date_str
243
245
244
246
try :
245
247
# Test strftime("%x") with the current locale.
246
248
import locale # Might not exist on some platforms, such as Windows
247
249
locale_formatter = mdates .DateFormatter ("%x" )
248
250
locale_d_fmt = locale .nl_langinfo (locale .D_FMT )
249
251
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 )
252
255
except (ImportError , AttributeError ):
253
256
pass
254
257
You can’t perform that action at this time.
0 commit comments