From 7885fd3155d7c3b287bf1e04b4523d9ef2cedd22 Mon Sep 17 00:00:00 2001 From: Shao Yang Hong Date: Sun, 11 Oct 2020 12:33:44 +0800 Subject: [PATCH] TST: Fix failing test from #37027 --- pandas/tests/tools/test_to_datetime.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index ef7c4be20e22e..63f9a2532fa73 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -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): @@ -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( @@ -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)