File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515from matplotlib import rc_context
1616
1717
18- def __has_pytz ():
19- try :
20- import pytz
21- return True
22- except ImportError :
23- return False
24-
25-
2618def test_date_numpyx ():
2719 # test that numpy dates work properly...
2820 base = datetime .datetime (2017 , 1 , 1 )
@@ -710,10 +702,9 @@ def attach_tz(dt, zi):
710702
711703
712704@pytest .mark .pytz
713- @pytest .mark .skipif (not __has_pytz (), reason = "Requires pytz" )
714705def test_rrulewrapper_pytz ():
715706 # Test to make sure pytz zones are supported in rrules
716- import pytz
707+ pytz = pytest . importorskip ( " pytz" )
717708
718709 def attach_tz (dt , zi ):
719710 return zi .localize (dt )
@@ -722,9 +713,8 @@ def attach_tz(dt, zi):
722713
723714
724715@pytest .mark .pytz
725- @pytest .mark .skipif (not __has_pytz (), reason = "Requires pytz" )
726716def test_yearlocator_pytz ():
727- import pytz
717+ pytz = pytest . importorskip ( " pytz" )
728718
729719 tz = pytz .timezone ('America/New_York' )
730720 x = [tz .localize (datetime .datetime (2010 , 1 , 1 ))
You can’t perform that action at this time.
0 commit comments