File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 21
21
from pandas .util import py3compat
22
22
from pandas .lib import Timestamp
23
23
from pandas .tseries .index import date_range
24
+ import pandas .tseries .tools as tools
24
25
25
26
from numpy .testing .decorators import slow
26
27
from pandas .io .date_converters import (
@@ -1490,7 +1491,14 @@ def test_parse_tz_aware(self):
1490
1491
result = read_csv (data , index_col = 0 , parse_dates = True )
1491
1492
stamp = result .index [0 ]
1492
1493
self .assert_ (stamp .minute == 39 )
1493
- self .assert_ (result .index .tz is pytz .utc )
1494
+ try :
1495
+ self .assert_ (result .index .tz is pytz .utc )
1496
+ except AssertionError : # hello Yaroslav
1497
+ arr = result .index .to_pydatetime ()
1498
+ result = tools .to_datetime (arr , utc = True )[0 ]
1499
+ self .assert_ (stamp .minute == result .minute )
1500
+ self .assert_ (stamp .hour == result .hour )
1501
+ self .assert_ (stamp .day == result .day )
1494
1502
1495
1503
class TestParseSQL (unittest .TestCase ):
1496
1504
Original file line number Diff line number Diff line change @@ -433,11 +433,10 @@ def test_to_datetime_tzlocal(self):
433
433
self .assert_ (result .tz is pytz .utc )
434
434
435
435
rng = date_range ('2012-11-03 03:00' , '2012-11-05 03:00' , tz = tzlocal ())
436
- rs1 = rng .to_pydatetime ()
437
- result = to_datetime (np . array ( result . asobject ) , utc = True )
436
+ arr = rng .to_pydatetime ()
437
+ result = to_datetime (arr , utc = True )
438
438
self .assert_ (result .tz is pytz .utc )
439
439
440
-
441
440
def test_frame_no_datetime64_dtype (self ):
442
441
dr = date_range ('2011/1/1' , '2012/1/1' , freq = 'W-FRI' )
443
442
dr_tz = dr .tz_localize ('US/Eastern' )
You can’t perform that action at this time.
0 commit comments