File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -519,14 +519,14 @@ def test_finder_hourly(self):
519519 xp = Period ('1/1/1999' , freq = 'H' ).ordinal
520520 assert rs == xp
521521
522+ @td .skip_if_mpl_1_5
522523 @pytest .mark .slow
523524 def test_gaps (self ):
524525 ts = tm .makeTimeSeries ()
525526 ts [5 :25 ] = np .nan
526527 _ , ax = self .plt .subplots ()
527528 ts .plot (ax = ax )
528529 lines = ax .get_lines ()
529- tm ._skip_if_mpl_1_5 ()
530530 assert len (lines ) == 1
531531 l = lines [0 ]
532532 data = l .get_xydata ()
@@ -564,6 +564,7 @@ def test_gaps(self):
564564 mask = data .mask
565565 assert mask [2 :5 , 1 ].all ()
566566
567+ @td .skip_if_mpl_1_5
567568 @pytest .mark .slow
568569 def test_gap_upsample (self ):
569570 low = tm .makeTimeSeries ()
@@ -580,8 +581,6 @@ def test_gap_upsample(self):
580581 l = lines [0 ]
581582 data = l .get_xydata ()
582583
583- tm ._skip_if_mpl_1_5 ()
584-
585584 assert isinstance (data , np .ma .core .MaskedArray )
586585 mask = data .mask
587586 assert mask [5 :25 , 1 ].all ()
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def test_foo():
2525"""
2626
2727import pytest
28+ from distutils .version import LooseVersion
2829
2930
3031def safe_import (mod_name , min_version = None ):
@@ -67,5 +68,18 @@ def _skip_if_no_mpl():
6768 return True
6869
6970
71+ def _skip_if_mpl_1_5 ():
72+ mod = safe_import ("matplotlib" )
73+
74+ if mod :
75+ v = mod .__version__
76+ if LooseVersion (v ) > LooseVersion ('1.4.3' ) or str (v )[0 ] == '0' :
77+ return True
78+ else :
79+ mod .use ("Agg" , warn = False )
80+
81+
7082skip_if_no_mpl = pytest .mark .skipif (_skip_if_no_mpl (),
7183 reason = "Missing matplotlib dependency" )
84+ skip_if_mpl_1_5 = pytest .mark .skipif (_skip_if_mpl_1_5 (),
85+ reason = "matplotlib 1.5" )
You can’t perform that action at this time.
0 commit comments