Skip to content

Commit a7c769f

Browse files
author
MarcoGorelli
committed
fixup tests
1 parent 148eda7 commit a7c769f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

pandas/tests/tools/test_to_datetime.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,19 @@ def test_to_datetime_with_non_exact(self, cache):
341341
tm.assert_series_equal(result, expected)
342342

343343
@pytest.mark.parametrize(
344-
"arg, warning",
344+
"arg",
345345
[
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",
351351
],
352352
)
353-
def test_parse_nanoseconds_with_formula(self, cache, arg, warning):
353+
def test_parse_nanoseconds_with_formula(self, cache, arg):
354354
# GH8989
355355
# 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)
358357
result = to_datetime(arg, format="%Y-%m-%d %H:%M:%S.%f", cache=cache)
359358
assert result == expected
360359

@@ -2649,8 +2648,7 @@ def test_arg_tz_ns_unit(self, offset, utc, exp):
26492648
# GH 25546
26502649
arg = "2019-01-01T00:00:00.000" + offset
26512650
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])
26542652
tm.assert_index_equal(result, expected)
26552653

26562654

0 commit comments

Comments
 (0)