11# pylint: disable-msg=E1101,W0612
2- from datetime import datetime , time , timedelta , tzinfo , date
2+ from datetime import datetime , timedelta , tzinfo , date
33import sys
44import os
55import unittest
88import numpy as np
99import pytz
1010
11- from pandas import (Index , Series , TimeSeries , DataFrame , isnull ,
12- date_range , Timestamp )
11+ from pandas import (Index , Series , DataFrame , isnull , Timestamp )
1312
14- from pandas import DatetimeIndex , Int64Index , to_datetime , NaT
13+ from pandas import DatetimeIndex , to_datetime , NaT
1514from pandas import tslib
1615
1716import pandas .core .datetools as datetools
2019import pandas .tseries .tools as tools
2120from pytz import NonExistentTimeError
2221
23- from pandas .util .testing import assert_series_equal , assert_almost_equal , assertRaisesRegexp
2422import pandas .util .testing as tm
2523
26- import pandas .lib as lib
27- import pandas .core .datetools as dt
28- from numpy .random import rand
2924from pandas .util .testing import assert_frame_equal
30- import pandas .compat as compat
31- from pandas .compat import range , lrange , zip , cPickle as pickle
32- from pandas .core .datetools import BDay
33- import pandas .core .common as com
25+ from pandas .compat import lrange , zip
3426
3527from pandas import _np_version_under1p7
3628
@@ -544,13 +536,13 @@ def test_localized_at_time_between_time(self):
544536
545537 result = ts_local .at_time (time (10 , 0 ))
546538 expected = ts .at_time (time (10 , 0 )).tz_localize (self .tzstr ('US/Eastern' ))
547- assert_series_equal (result , expected )
539+ tm . assert_series_equal (result , expected )
548540 self .assertTrue (self .cmptz (result .index .tz , self .tz ('US/Eastern' )))
549541
550542 t1 , t2 = time (10 , 0 ), time (11 , 0 )
551543 result = ts_local .between_time (t1 , t2 )
552544 expected = ts .between_time (t1 , t2 ).tz_localize (self .tzstr ('US/Eastern' ))
553- assert_series_equal (result , expected )
545+ tm . assert_series_equal (result , expected )
554546 self .assertTrue (self .cmptz (result .index .tz , self .tz ('US/Eastern' )))
555547
556548 def test_string_index_alias_tz_aware (self ):
@@ -631,7 +623,7 @@ def test_frame_no_datetime64_dtype(self):
631623 'datetimes_with_tz' : datetimes_with_tz })
632624 result = df .get_dtype_counts ()
633625 expected = Series ({ 'datetime64[ns]' : 3 , 'object' : 1 })
634- assert_series_equal (result , expected )
626+ tm . assert_series_equal (result , expected )
635627
636628 def test_hongkong_tz_convert (self ):
637629 # #1673
@@ -863,7 +855,7 @@ def test_series_frame_tz_localize(self):
863855 # Can't localize if already tz-aware
864856 rng = date_range ('1/1/2011' , periods = 100 , freq = 'H' , tz = 'utc' )
865857 ts = Series (1 , index = rng )
866- assertRaisesRegexp (TypeError , 'Already tz-aware' , ts .tz_localize , 'US/Eastern' )
858+ tm . assertRaisesRegexp (TypeError , 'Already tz-aware' , ts .tz_localize , 'US/Eastern' )
867859
868860 def test_series_frame_tz_convert (self ):
869861 rng = date_range ('1/1/2011' , periods = 200 , freq = 'D' ,
@@ -887,7 +879,7 @@ def test_series_frame_tz_convert(self):
887879 # can't convert tz-naive
888880 rng = date_range ('1/1/2011' , periods = 200 , freq = 'D' )
889881 ts = Series (1 , index = rng )
890- assertRaisesRegexp (TypeError , "Cannot convert tz-naive" , ts .tz_convert , 'US/Eastern' )
882+ tm . assertRaisesRegexp (TypeError , "Cannot convert tz-naive" , ts .tz_convert , 'US/Eastern' )
891883
892884 def test_join_utc_convert (self ):
893885 rng = date_range ('1/1/2011' , periods = 100 , freq = 'H' , tz = 'utc' )
@@ -1033,7 +1025,7 @@ def test_arith_utc_convert(self):
10331025 expected = uts1 + uts2
10341026
10351027 self .assertEqual (result .index .tz , pytz .UTC )
1036- assert_series_equal (result , expected )
1028+ tm . assert_series_equal (result , expected )
10371029
10381030 def test_intersection (self ):
10391031 rng = date_range ('1/1/2011' , periods = 100 , freq = 'H' , tz = 'utc' )
0 commit comments