@@ -5091,27 +5091,7 @@ def test_broken_barh_empty():
50915091 ax .broken_barh ([], (.1 , .5 ))
50925092
50935093
5094- def _pandas_wrapper (func ):
5095- '''Decorator to centralize pandas setup / conditional import'''
5096- import functools
5097-
5098- @functools .wraps (func )
5099- def wrapped_for_pandas (* args , ** kwargs ):
5100- pytest .importorskip ('pandas' )
5101- try :
5102- from pandas .plotting import (
5103- register_matplotlib_converters as register )
5104- except ImportError :
5105- from pandas .tseries .converter import register
5106- register ()
5107- return func (* args , ** kwargs )
5108-
5109- return wrapped_for_pandas
5110-
5111-
5112- @_pandas_wrapper
5113- def test_pandas_pcolormesh ():
5114- import pandas as pd
5094+ def test_pandas_pcolormesh (pd ):
51155095 time = pd .date_range ('2000-01-01' , periods = 10 )
51165096 depth = np .arange (20 )
51175097 data = np .random .rand (20 , 10 )
@@ -5120,10 +5100,7 @@ def test_pandas_pcolormesh():
51205100 ax .pcolormesh (time , depth , data )
51215101
51225102
5123- @_pandas_wrapper
5124- def test_pandas_indexing_dates ():
5125- import pandas as pd
5126-
5103+ def test_pandas_indexing_dates (pd ):
51275104 dates = np .arange ('2005-02' , '2005-03' , dtype = 'datetime64[D]' )
51285105 values = np .sin (np .array (range (len (dates ))))
51295106 df = pd .DataFrame ({'dates' : dates , 'values' : values })
@@ -5134,32 +5111,23 @@ def test_pandas_indexing_dates():
51345111 ax .plot ('dates' , 'values' , data = without_zero_index )
51355112
51365113
5137- @_pandas_wrapper
5138- def test_pandas_errorbar_indexing ():
5139- import pandas as pd
5140-
5114+ def test_pandas_errorbar_indexing (pd ):
51415115 df = pd .DataFrame (np .random .uniform (size = (5 , 4 )),
51425116 columns = ['x' , 'y' , 'xe' , 'ye' ],
51435117 index = [1 , 2 , 3 , 4 , 5 ])
51445118 fig , ax = plt .subplots ()
51455119 ax .errorbar ('x' , 'y' , xerr = 'xe' , yerr = 'ye' , data = df )
51465120
51475121
5148- @_pandas_wrapper
5149- def test_pandas_indexing_hist ():
5150- import pandas as pd
5151-
5122+ def test_pandas_indexing_hist (pd ):
51525123 ser_1 = pd .Series (data = [1 , 2 , 2 , 3 , 3 , 4 , 4 , 4 , 4 , 5 ])
51535124 ser_2 = ser_1 .iloc [1 :]
51545125 fig , axes = plt .subplots ()
51555126 axes .hist (ser_2 )
51565127
51575128
5158- @_pandas_wrapper
5159- def test_pandas_bar_align_center ():
5129+ def test_pandas_bar_align_center (pd ):
51605130 # Tests fix for issue 8767
5161- import pandas as pd
5162-
51635131 df = pd .DataFrame ({'a' : range (2 ), 'b' : range (2 )})
51645132
51655133 fig , ax = plt .subplots (1 )
0 commit comments