File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 15
15
from matplotlib import rc_context
16
16
17
17
18
- def __has_pytz ():
19
- try :
20
- import pytz
21
- return True
22
- except ImportError :
23
- return False
24
-
25
-
26
18
def test_date_numpyx ():
27
19
# test that numpy dates work properly...
28
20
base = datetime .datetime (2017 , 1 , 1 )
@@ -710,10 +702,9 @@ def attach_tz(dt, zi):
710
702
711
703
712
704
@pytest .mark .pytz
713
- @pytest .mark .skipif (not __has_pytz (), reason = "Requires pytz" )
714
705
def test_rrulewrapper_pytz ():
715
706
# Test to make sure pytz zones are supported in rrules
716
- import pytz
707
+ pytz = pytest . importorskip ( " pytz" )
717
708
718
709
def attach_tz (dt , zi ):
719
710
return zi .localize (dt )
@@ -722,9 +713,8 @@ def attach_tz(dt, zi):
722
713
723
714
724
715
@pytest .mark .pytz
725
- @pytest .mark .skipif (not __has_pytz (), reason = "Requires pytz" )
726
716
def test_yearlocator_pytz ():
727
- import pytz
717
+ pytz = pytest . importorskip ( " pytz" )
728
718
729
719
tz = pytz .timezone ('America/New_York' )
730
720
x = [tz .localize (datetime .datetime (2010 , 1 , 1 ))
You can’t perform that action at this time.
0 commit comments