Skip to content

Commit 3c2a833

Browse files
committed
added testcase
1 parent 946edbf commit 3c2a833

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/tools/test_to_datetime.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,11 @@ def test_invalid_origins_tzinfo(self):
25912591
with pytest.raises(ValueError, match="must be tz-naive"):
25922592
to_datetime(1, unit="D", origin=datetime(2000, 1, 1, tzinfo=pytz.utc))
25932593

2594+
def test_incorrect_value_exception(self):
2595+
# GH47495
2596+
with pytest.raises(ValueError, match="Unknown string format: today"):
2597+
to_datetime(["today", "yesterday"])
2598+
25942599
@pytest.mark.parametrize("format", [None, "%Y-%m-%d %H:%M:%S"])
25952600
def test_to_datetime_out_of_bounds_with_format_arg(self, format):
25962601
# see gh-23830

0 commit comments

Comments
 (0)