8
8
from dateutil .parser import parse
9
9
10
10
import pandas .util ._test_decorators as td
11
- from pandas .conftest import is_dateutil_le_261 , is_dateutil_gt_261
12
11
from pandas import compat
13
12
from pandas .util import testing as tm
14
13
from pandas ._libs .tslibs import parsing
@@ -96,7 +95,6 @@ def test_parsers_monthfreq(self):
96
95
class TestGuessDatetimeFormat (object ):
97
96
98
97
@td .skip_if_not_us_locale
99
- @is_dateutil_le_261
100
98
@pytest .mark .parametrize (
101
99
"string, format" ,
102
100
[
@@ -112,19 +110,6 @@ def test_guess_datetime_format_with_parseable_formats(
112
110
result = parsing ._guess_datetime_format (string )
113
111
assert result == format
114
112
115
- @td .skip_if_not_us_locale
116
- @is_dateutil_gt_261
117
- @pytest .mark .parametrize (
118
- "string" ,
119
- ['20111230' , '2011-12-30' , '30-12-2011' ,
120
- '2011-12-30 00:00:00' , '2011-12-30T00:00:00' ,
121
- '2011-12-30 00:00:00.000000' ])
122
- def test_guess_datetime_format_with_parseable_formats_gt_261 (
123
- self , string ):
124
- result = parsing ._guess_datetime_format (string )
125
- assert result is None
126
-
127
- @is_dateutil_le_261
128
113
@pytest .mark .parametrize (
129
114
"dayfirst, expected" ,
130
115
[
@@ -136,17 +121,7 @@ def test_guess_datetime_format_with_dayfirst(self, dayfirst, expected):
136
121
ambiguous_string , dayfirst = dayfirst )
137
122
assert result == expected
138
123
139
- @is_dateutil_gt_261
140
- @pytest .mark .parametrize (
141
- "dayfirst" , [True , False ])
142
- def test_guess_datetime_format_with_dayfirst_gt_261 (self , dayfirst ):
143
- ambiguous_string = '01/01/2011'
144
- result = parsing ._guess_datetime_format (
145
- ambiguous_string , dayfirst = dayfirst )
146
- assert result is None
147
-
148
124
@td .skip_if_has_locale
149
- @is_dateutil_le_261
150
125
@pytest .mark .parametrize (
151
126
"string, format" ,
152
127
[
@@ -158,19 +133,6 @@ def test_guess_datetime_format_with_locale_specific_formats(
158
133
result = parsing ._guess_datetime_format (string )
159
134
assert result == format
160
135
161
- @td .skip_if_has_locale
162
- @is_dateutil_gt_261
163
- @pytest .mark .parametrize (
164
- "string" ,
165
- [
166
- '30/Dec/2011' ,
167
- '30/December/2011' ,
168
- '30/Dec/2011 00:00:00' ])
169
- def test_guess_datetime_format_with_locale_specific_formats_gt_261 (
170
- self , string ):
171
- result = parsing ._guess_datetime_format (string )
172
- assert result is None
173
-
174
136
def test_guess_datetime_format_invalid_inputs (self ):
175
137
# A datetime string must include a year, month and a day for it
176
138
# to be guessable, in addition to being a string that looks like
@@ -189,7 +151,6 @@ def test_guess_datetime_format_invalid_inputs(self):
189
151
for invalid_dt in invalid_dts :
190
152
assert parsing ._guess_datetime_format (invalid_dt ) is None
191
153
192
- @is_dateutil_le_261
193
154
@pytest .mark .parametrize (
194
155
"string, format" ,
195
156
[
@@ -204,21 +165,6 @@ def test_guess_datetime_format_nopadding(self, string, format):
204
165
result = parsing ._guess_datetime_format (string )
205
166
assert result == format
206
167
207
- @is_dateutil_gt_261
208
- @pytest .mark .parametrize (
209
- "string" ,
210
- [
211
- '2011-1-1' ,
212
- '30-1-2011' ,
213
- '1/1/2011' ,
214
- '2011-1-1 00:00:00' ,
215
- '2011-1-1 0:0:0' ,
216
- '2011-1-3T00:00:0' ])
217
- def test_guess_datetime_format_nopadding_gt_261 (self , string ):
218
- # GH 11142
219
- result = parsing ._guess_datetime_format (string )
220
- assert result is None
221
-
222
168
223
169
class TestArrayToDatetime (object ):
224
170
def test_try_parse_dates (self ):
0 commit comments