22
22
from pandas .core .dtypes .common import is_datetime64_ns_dtype
23
23
from pandas .util import testing as tm
24
24
import pandas .util ._test_decorators as td
25
- from pandas .util .testing import assert_series_equal , _skip_if_has_locale
25
+ from pandas .util .testing import assert_series_equal
26
26
from pandas import (isna , to_datetime , Timestamp , Series , DataFrame ,
27
27
Index , DatetimeIndex , NaT , date_range , compat )
28
28
@@ -144,11 +144,10 @@ def test_to_datetime_format_time(self, cache):
144
144
for s , format , dt in data :
145
145
assert to_datetime (s , format = format , cache = cache ) == dt
146
146
147
+ @td .skip_if_has_locale
147
148
@pytest .mark .parametrize ('cache' , [True , False ])
148
149
def test_to_datetime_with_non_exact (self , cache ):
149
150
# GH 10834
150
- tm ._skip_if_has_locale ()
151
-
152
151
# 8904
153
152
# exact kw
154
153
if sys .version_info < (2 , 7 ):
@@ -830,11 +829,10 @@ def test_to_datetime_with_space_in_series(self, cache):
830
829
result_ignore = to_datetime (s , errors = 'ignore' , cache = cache )
831
830
tm .assert_series_equal (result_ignore , s )
832
831
832
+ @td .skip_if_has_locale
833
833
@pytest .mark .parametrize ('cache' , [True , False ])
834
834
def test_to_datetime_with_apply (self , cache ):
835
835
# this is only locale tested with US/None locales
836
- tm ._skip_if_has_locale ()
837
-
838
836
# GH 5195
839
837
# with a format and coerce a single item to_datetime fails
840
838
td = Series (['May 04' , 'Jun 02' , 'Dec 11' ], index = [1 , 2 , 3 ])
@@ -1023,9 +1021,9 @@ def test_dayfirst(self, cache):
1023
1021
1024
1022
class TestGuessDatetimeFormat (object ):
1025
1023
1024
+ @td .skip_if_not_us_locale
1026
1025
@is_dateutil_le_261
1027
1026
def test_guess_datetime_format_for_array (self ):
1028
- tm ._skip_if_not_us_locale ()
1029
1027
expected_format = '%Y-%m-%d %H:%M:%S.%f'
1030
1028
dt_string = datetime (2011 , 12 , 30 , 0 , 0 , 0 ).strftime (expected_format )
1031
1029
@@ -1044,9 +1042,9 @@ def test_guess_datetime_format_for_array(self):
1044
1042
[np .nan , np .nan , np .nan ], dtype = 'O' ))
1045
1043
assert format_for_string_of_nans is None
1046
1044
1045
+ @td .skip_if_not_us_locale
1047
1046
@is_dateutil_gt_261
1048
1047
def test_guess_datetime_format_for_array_gt_261 (self ):
1049
- tm ._skip_if_not_us_locale ()
1050
1048
expected_format = '%Y-%m-%d %H:%M:%S.%f'
1051
1049
dt_string = datetime (2011 , 12 , 30 , 0 , 0 , 0 ).strftime (expected_format )
1052
1050
@@ -1393,9 +1391,9 @@ def test_parsers_timestring(self, cache):
1393
1391
assert result4 == exp_now
1394
1392
assert result5 == exp_now
1395
1393
1394
+ @td .skip_if_has_locale
1396
1395
def test_parsers_time (self ):
1397
1396
# GH11818
1398
- _skip_if_has_locale ()
1399
1397
strings = ["14:15" , "1415" , "2:15pm" , "0215pm" , "14:15:00" , "141500" ,
1400
1398
"2:15:00pm" , "021500pm" , time (14 , 15 )]
1401
1399
expected = time (14 , 15 )
0 commit comments