@@ -91,30 +91,26 @@ def test_does_not_convert_mixed_integer(self):
9191class TestArrayToDatetime (tm .TestCase ):
9292 def test_parsing_valid_dates (self ):
9393 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 (
9897 [
9998 '2013-01-01T00:00:00.000000000-0000' ,
10099 '2013-01-02T00:00:00.000000000-0000'
101100 ],
102101 dtype = 'M8[ns]'
103- )
104102 )
105103 )
106104
107105 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 (
112109 [
113110 '2013-09-16T00:00:00.000000000-0000' ,
114111 '2013-09-17T00:00:00.000000000-0000'
115112 ],
116113 dtype = 'M8[ns]'
117- )
118114 )
119115 )
120116
@@ -155,16 +151,14 @@ def test_coercing_dates_outside_of_datetime64_ns_bounds(self):
155151 )
156152
157153 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 (
162157 [
163158 tslib .iNaT ,
164159 '2000-01-01T00:00:00.000000000-0000'
165160 ],
166161 dtype = 'M8[ns]'
167- )
168162 )
169163 )
170164
@@ -176,17 +170,15 @@ def test_coerce_of_invalid_datetimes(self):
176170 self .assert_numpy_array_equal (tslib .array_to_datetime (arr ), arr )
177171
178172 # 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 (
183176 [
184177 '2013-01-01T00:00:00.000000000-0000' ,
185178 tslib .iNaT ,
186179 tslib .iNaT
187180 ],
188181 dtype = 'M8[ns]'
189- )
190182 )
191183 )
192184
@@ -205,13 +197,11 @@ def test_parsing_timezone_offsets(self):
205197 )
206198
207199 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
215205 )
216206
217207class TestTimestampNsOperations (tm .TestCase ):
0 commit comments