@@ -91,30 +91,26 @@ def test_does_not_convert_mixed_integer(self):
91
91
class TestArrayToDatetime (tm .TestCase ):
92
92
def test_parsing_valid_dates (self ):
93
93
arr = np .array (['01-01-2013' , '01-02-2013' ], dtype = object )
94
- self .assert_ (
95
- np .array_equal (
96
- tslib .array_to_datetime (arr ),
97
- np .array (
94
+ self .assert_numpy_array_equal (
95
+ tslib .array_to_datetime (arr ),
96
+ np .array (
98
97
[
99
98
'2013-01-01T00:00:00.000000000-0000' ,
100
99
'2013-01-02T00:00:00.000000000-0000'
101
100
],
102
101
dtype = 'M8[ns]'
103
- )
104
102
)
105
103
)
106
104
107
105
arr = np .array (['Mon Sep 16 2013' , 'Tue Sep 17 2013' ], dtype = object )
108
- self .assert_ (
109
- np .array_equal (
110
- tslib .array_to_datetime (arr ),
111
- np .array (
106
+ self .assert_numpy_array_equal (
107
+ tslib .array_to_datetime (arr ),
108
+ np .array (
112
109
[
113
110
'2013-09-16T00:00:00.000000000-0000' ,
114
111
'2013-09-17T00:00:00.000000000-0000'
115
112
],
116
113
dtype = 'M8[ns]'
117
- )
118
114
)
119
115
)
120
116
@@ -155,16 +151,14 @@ def test_coercing_dates_outside_of_datetime64_ns_bounds(self):
155
151
)
156
152
157
153
arr = np .array (['1/1/1000' , '1/1/2000' ], dtype = object )
158
- self .assert_ (
159
- np .array_equal (
160
- tslib .array_to_datetime (arr , coerce = True ),
161
- np .array (
154
+ self .assert_numpy_array_equal (
155
+ tslib .array_to_datetime (arr , coerce = True ),
156
+ np .array (
162
157
[
163
158
tslib .iNaT ,
164
159
'2000-01-01T00:00:00.000000000-0000'
165
160
],
166
161
dtype = 'M8[ns]'
167
- )
168
162
)
169
163
)
170
164
@@ -176,17 +170,15 @@ def test_coerce_of_invalid_datetimes(self):
176
170
self .assert_numpy_array_equal (tslib .array_to_datetime (arr ), arr )
177
171
178
172
# With coercing, the invalid dates becomes iNaT
179
- self .assert_ (
180
- np .array_equal (
181
- tslib .array_to_datetime (arr , coerce = True ),
182
- np .array (
173
+ self .assert_numpy_array_equal (
174
+ tslib .array_to_datetime (arr , coerce = True ),
175
+ np .array (
183
176
[
184
177
'2013-01-01T00:00:00.000000000-0000' ,
185
178
tslib .iNaT ,
186
179
tslib .iNaT
187
180
],
188
181
dtype = 'M8[ns]'
189
- )
190
182
)
191
183
)
192
184
@@ -205,13 +197,11 @@ def test_parsing_timezone_offsets(self):
205
197
)
206
198
207
199
for dt_string in dt_strings :
208
- self .assert_ (
209
- np .array_equal (
210
- tslib .array_to_datetime (
211
- np .array ([dt_string ], dtype = object )
212
- ),
213
- expected_output
214
- )
200
+ self .assert_numpy_array_equal (
201
+ tslib .array_to_datetime (
202
+ np .array ([dt_string ], dtype = object )
203
+ ),
204
+ expected_output
215
205
)
216
206
217
207
class TestTimestampNsOperations (tm .TestCase ):
0 commit comments