@@ -341,20 +341,19 @@ def test_to_datetime_with_non_exact(self, cache):
341
341
tm .assert_series_equal (result , expected )
342
342
343
343
@pytest .mark .parametrize (
344
- "arg, warning " ,
344
+ "arg" ,
345
345
[
346
- ( "2012-01-01 09:00:00.000000001" , UserWarning ) ,
347
- ( "2012-01-01 09:00:00.000001" , None ) ,
348
- ( "2012-01-01 09:00:00.001" , UserWarning ) ,
349
- ( "2012-01-01 09:00:00.001000" , None ) ,
350
- ( "2012-01-01 09:00:00.001000000" , UserWarning ) ,
346
+ "2012-01-01 09:00:00.000000001" ,
347
+ "2012-01-01 09:00:00.000001" ,
348
+ "2012-01-01 09:00:00.001" ,
349
+ "2012-01-01 09:00:00.001000" ,
350
+ "2012-01-01 09:00:00.001000000" ,
351
351
],
352
352
)
353
- def test_parse_nanoseconds_with_formula (self , cache , arg , warning ):
353
+ def test_parse_nanoseconds_with_formula (self , cache , arg ):
354
354
# GH8989
355
355
# truncating the nanoseconds when a format was provided
356
- with tm .assert_produces_warning (warning , match = "Could not infer format" ):
357
- expected = to_datetime (arg , cache = cache )
356
+ expected = to_datetime (arg , cache = cache )
358
357
result = to_datetime (arg , format = "%Y-%m-%d %H:%M:%S.%f" , cache = cache )
359
358
assert result == expected
360
359
@@ -2649,8 +2648,7 @@ def test_arg_tz_ns_unit(self, offset, utc, exp):
2649
2648
# GH 25546
2650
2649
arg = "2019-01-01T00:00:00.000" + offset
2651
2650
result = to_datetime ([arg ], unit = "ns" , utc = utc )
2652
- with tm .assert_produces_warning (UserWarning , match = "Could not infer format" ):
2653
- expected = to_datetime ([exp ])
2651
+ expected = to_datetime ([exp ])
2654
2652
tm .assert_index_equal (result , expected )
2655
2653
2656
2654
0 commit comments