File tree 1 file changed +14
-8
lines changed 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -272,15 +272,21 @@ def test_to_datetime_barely_out_of_bounds():
272
272
tslib .array_to_datetime (arr )
273
273
274
274
275
- def test_to_datetime_barely_inside_bounds ():
275
+ @pytest .mark .parametrize (
276
+ "timestamp" ,
277
+ [
278
+ # Close enough to bounds that scaling micros to nanos overflows
279
+ # but adding nanos would result in an in-bounds datetime.
280
+ "1677-09-21T00:12:43.145224193" ,
281
+ "1677-09-21T00:12:43.145224999" ,
282
+ # this always worked
283
+ "1677-09-21T00:12:43.145225000" ,
284
+ ],
285
+ )
286
+ def test_to_datetime_barely_inside_bounds (timestamp ):
276
287
# see gh-57150
277
- #
278
- # Close enough to bounds that scaling micros to nanos overflows
279
- # but adding nanos would result in an in-bounds datetime.
280
- arr = np .array (["1677-09-21T00:12:43.145224193" ], dtype = object )
281
- result , _ = tslib .array_to_datetime (arr )
282
- expected = ["1677-09-21T00:12:43.145224193" ]
283
- tm .assert_numpy_array_equal (result , np .array (expected , dtype = "M8[ns]" ))
288
+ result , _ = tslib .array_to_datetime (np .array ([timestamp ], dtype = object ))
289
+ tm .assert_numpy_array_equal (result , np .array ([timestamp ], dtype = "M8[ns]" ))
284
290
285
291
286
292
class SubDatetime (datetime ):
You can’t perform that action at this time.
0 commit comments