@@ -111,12 +111,15 @@ def test_tsplot_deprecated(self):
111
111
112
112
@pytest .mark .slow
113
113
def test_tsplot (self ):
114
+
114
115
from pandas .tseries .plotting import tsplot
115
116
116
117
_ , ax = self .plt .subplots ()
117
118
ts = tm .makeTimeSeries ()
118
119
119
- f = lambda * args , ** kwds : tsplot (s , self .plt .Axes .plot , * args , ** kwds )
120
+ def f (* args , ** kwds ):
121
+ with tm .assert_produces_warning (FutureWarning ):
122
+ return tsplot (s , self .plt .Axes .plot , * args , ** kwds )
120
123
121
124
for s in self .period_ser :
122
125
_check_plot_works (f , s .index .freq , ax = ax , series = s )
@@ -188,11 +191,13 @@ def check_format_of_first_point(ax, expected_string):
188
191
tm .close ()
189
192
190
193
# tsplot
191
- _ , ax = self .plt .subplots ()
192
194
from pandas .tseries .plotting import tsplot
193
- tsplot (annual , self .plt .Axes .plot , ax = ax )
195
+ _ , ax = self .plt .subplots ()
196
+ with tm .assert_produces_warning (FutureWarning ):
197
+ tsplot (annual , self .plt .Axes .plot , ax = ax )
194
198
check_format_of_first_point (ax , 't = 2014 y = 1.000000' )
195
- tsplot (daily , self .plt .Axes .plot , ax = ax )
199
+ with tm .assert_produces_warning (FutureWarning ):
200
+ tsplot (daily , self .plt .Axes .plot , ax = ax )
196
201
check_format_of_first_point (ax , 't = 2014-01-01 y = 1.000000' )
197
202
198
203
@pytest .mark .slow
@@ -879,12 +884,12 @@ def test_to_weekly_resampling(self):
879
884
for l in ax .get_lines ():
880
885
assert PeriodIndex (data = l .get_xdata ()).freq == idxh .freq
881
886
882
- # tsplot
883
- from pandas .tseries .plotting import tsplot
884
-
885
887
_ , ax = self .plt .subplots ()
886
- tsplot (high , self .plt .Axes .plot , ax = ax )
887
- lines = tsplot (low , self .plt .Axes .plot , ax = ax )
888
+ from pandas .tseries .plotting import tsplot
889
+ with tm .assert_produces_warning (FutureWarning ):
890
+ tsplot (high , self .plt .Axes .plot , ax = ax )
891
+ with tm .assert_produces_warning (FutureWarning ):
892
+ lines = tsplot (low , self .plt .Axes .plot , ax = ax )
888
893
for l in lines :
889
894
assert PeriodIndex (data = l .get_xdata ()).freq == idxh .freq
890
895
@@ -910,12 +915,12 @@ def test_from_weekly_resampling(self):
910
915
tm .assert_numpy_array_equal (xdata , expected_h )
911
916
tm .close ()
912
917
913
- # tsplot
914
- from pandas .tseries .plotting import tsplot
915
-
916
918
_ , ax = self .plt .subplots ()
917
- tsplot (low , self .plt .Axes .plot , ax = ax )
918
- lines = tsplot (high , self .plt .Axes .plot , ax = ax )
919
+ from pandas .tseries .plotting import tsplot
920
+ with tm .assert_produces_warning (FutureWarning ):
921
+ tsplot (low , self .plt .Axes .plot , ax = ax )
922
+ with tm .assert_produces_warning (FutureWarning ):
923
+ lines = tsplot (high , self .plt .Axes .plot , ax = ax )
919
924
for l in lines :
920
925
assert PeriodIndex (data = l .get_xdata ()).freq == idxh .freq
921
926
xdata = l .get_xdata (orig = False )
@@ -1351,9 +1356,11 @@ def test_plot_outofbounds_datetime(self):
1351
1356
values = [datetime (1677 , 1 , 1 , 12 ), datetime (1677 , 1 , 2 , 12 )]
1352
1357
ax .plot (values )
1353
1358
1359
+ @pytest .mark .skip (
1360
+ is_platform_mac (),
1361
+ "skip on mac for precision display issue on older mpl" )
1362
+ @pytest .mark .xfail (reason = "suspect on mpl 2.2.2" )
1354
1363
def test_format_timedelta_ticks_narrow (self ):
1355
- if is_platform_mac ():
1356
- pytest .skip ("skip on mac for precision display issue on older mpl" )
1357
1364
1358
1365
if self .mpl_ge_2_0_0 :
1359
1366
expected_labels = ['' ] + [
@@ -1374,9 +1381,11 @@ def test_format_timedelta_ticks_narrow(self):
1374
1381
for l , l_expected in zip (labels , expected_labels ):
1375
1382
assert l .get_text () == l_expected
1376
1383
1384
+ @pytest .mark .skip (
1385
+ is_platform_mac (),
1386
+ "skip on mac for precision display issue on older mpl" )
1387
+ @pytest .mark .xfail (reason = "suspect on mpl 2.2.2" )
1377
1388
def test_format_timedelta_ticks_wide (self ):
1378
- if is_platform_mac ():
1379
- pytest .skip ("skip on mac for precision display issue on older mpl" )
1380
1389
1381
1390
if self .mpl_ge_2_0_0 :
1382
1391
expected_labels = [
0 commit comments