88import pandas ._config .config as cf
99
1010from pandas .compat .numpy import np_datetime64_compat
11+ import pandas .util ._test_decorators as td
1112
1213from pandas import Index , Period , Series , Timestamp , date_range
1314import pandas ._testing as tm
@@ -59,16 +60,15 @@ def test_register_by_default(self):
5960 call = [sys .executable , "-c" , code ]
6061 assert subprocess .check_call (call ) == 0
6162
63+ @td .skip_if_no ("matplotlib" , min_version = "3.1.3" )
6264 def test_registering_no_warning (self ):
6365 plt = pytest .importorskip ("matplotlib.pyplot" )
6466 s = Series (range (12 ), index = date_range ("2017" , periods = 12 ))
6567 _ , ax = plt .subplots ()
6668
6769 # Set to the "warn" state, in case this isn't the first test run
6870 register_matplotlib_converters ()
69- with tm .assert_produces_warning (DeprecationWarning , check_stacklevel = False ):
70- # GH#30588 DeprecationWarning from 2D indexing
71- ax .plot (s .index , s .values )
71+ ax .plot (s .index , s .values )
7272
7373 def test_pandas_plots_register (self ):
7474 pytest .importorskip ("matplotlib.pyplot" )
@@ -91,6 +91,7 @@ def test_matplotlib_formatters(self):
9191 assert Timestamp not in units .registry
9292 assert Timestamp in units .registry
9393
94+ @td .skip_if_no ("matplotlib" , min_version = "3.1.3" )
9495 def test_option_no_warning (self ):
9596 pytest .importorskip ("matplotlib.pyplot" )
9697 ctx = cf .option_context ("plotting.matplotlib.register_converters" , False )
@@ -100,15 +101,12 @@ def test_option_no_warning(self):
100101
101102 # Test without registering first, no warning
102103 with ctx :
103- # GH#30588 DeprecationWarning from 2D indexing on Index
104- with tm .assert_produces_warning (DeprecationWarning , check_stacklevel = False ):
105- ax .plot (s .index , s .values )
104+ ax .plot (s .index , s .values )
106105
107106 # Now test with registering
108107 register_matplotlib_converters ()
109108 with ctx :
110- with tm .assert_produces_warning (DeprecationWarning , check_stacklevel = False ):
111- ax .plot (s .index , s .values )
109+ ax .plot (s .index , s .values )
112110
113111 def test_registry_resets (self ):
114112 units = pytest .importorskip ("matplotlib.units" )
0 commit comments