Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pandas/tests/tools/test_to_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def test_datetime_invalid_scalar(self, value, format, infer):

msg = (
"is a bad directive in format|"
"second must be in 0..59: 00:01:99|"
"second must be in 0..59|"
"Given date string not likely a datetime"
)
with pytest.raises(ValueError, match=msg):
Expand Down Expand Up @@ -886,7 +886,7 @@ def test_datetime_invalid_index(self, values, format, infer):
msg = (
"is a bad directive in format|"
"Given date string not likely a datetime|"
"second must be in 0..59: 00:01:99"
"second must be in 0..59"
)
with pytest.raises(ValueError, match=msg):
pd.to_datetime(
Expand Down Expand Up @@ -1660,7 +1660,11 @@ def test_to_datetime_overflow(self):
# gh-17637
# we are overflowing Timedelta range here

msg = "Python int too large to convert to C long"
msg = (
"(Python int too large to convert to C long)|"
"(long too big to convert)|"
"(int too big to convert)"
)
with pytest.raises(OverflowError, match=msg):
date_range(start="1/1/1700", freq="B", periods=100000)

Expand Down