8
8
import pandas ._config .config as cf
9
9
10
10
from pandas .compat .numpy import np_datetime64_compat
11
+ import pandas .util ._test_decorators as td
11
12
12
13
from pandas import Index , Period , Series , Timestamp , date_range
13
14
import pandas ._testing as tm
@@ -59,16 +60,15 @@ def test_register_by_default(self):
59
60
call = [sys .executable , "-c" , code ]
60
61
assert subprocess .check_call (call ) == 0
61
62
63
+ @td .skip_if_no ("matplotlib" , min_version = "3.1.3" )
62
64
def test_registering_no_warning (self ):
63
65
plt = pytest .importorskip ("matplotlib.pyplot" )
64
66
s = Series (range (12 ), index = date_range ("2017" , periods = 12 ))
65
67
_ , ax = plt .subplots ()
66
68
67
69
# Set to the "warn" state, in case this isn't the first test run
68
70
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 )
72
72
73
73
def test_pandas_plots_register (self ):
74
74
pytest .importorskip ("matplotlib.pyplot" )
@@ -91,6 +91,7 @@ def test_matplotlib_formatters(self):
91
91
assert Timestamp not in units .registry
92
92
assert Timestamp in units .registry
93
93
94
+ @td .skip_if_no ("matplotlib" , min_version = "3.1.3" )
94
95
def test_option_no_warning (self ):
95
96
pytest .importorskip ("matplotlib.pyplot" )
96
97
ctx = cf .option_context ("plotting.matplotlib.register_converters" , False )
@@ -100,15 +101,12 @@ def test_option_no_warning(self):
100
101
101
102
# Test without registering first, no warning
102
103
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 )
106
105
107
106
# Now test with registering
108
107
register_matplotlib_converters ()
109
108
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 )
112
110
113
111
def test_registry_resets (self ):
114
112
units = pytest .importorskip ("matplotlib.units" )
0 commit comments