Skip to content

Commit 5fe5d0c

Browse files
fixup merge
1 parent 25e595f commit 5fe5d0c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pandas/tests/tools/test_to_datetime.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@
6262
NOT_99 = ", not 99"
6363
DAY_IS_OUT_OF_RANGE = (
6464
r"day \d{1,2} must be in range 1\.\.\d{1,2} for month \d{1,2} in year \d{4}"
65+
", at position 0"
6566
)
6667
else:
6768
NOT_99 = ""
68-
DAY_IS_OUT_OF_RANGE = "day is out of range for month"
69+
DAY_IS_OUT_OF_RANGE = "day is out of range for month, at position 0"
6970

7071

7172
pytestmark = pytest.mark.filterwarnings(
@@ -1459,10 +1460,10 @@ def test_datetime_invalid_scalar(self, value, format):
14591460
[
14601461
r'^time data "a" doesn\'t match format "%H:%M:%S", at position 0. '
14611462
f"{PARSING_ERR_MSG}$",
1462-
r'^Given date string "a" not likely a datetime$',
1463-
r'^unconverted data remains when parsing with format "%H:%M:%S": "9". '
1464-
f"{PARSING_ERR_MSG}$",
1465-
rf"^second must be in 0..59{NOT_99}: 00:01:99$",
1463+
r'^Given date string "a" not likely a datetime, at position 0$',
1464+
r'^unconverted data remains when parsing with format "%H:%M:%S": "9", '
1465+
f"at position 0. {PARSING_ERR_MSG}$",
1466+
rf"^second must be in 0..59{NOT_99}: 00:01:99, at position 0$",
14661467
]
14671468
)
14681469
with pytest.raises(ValueError, match=msg):
@@ -1518,9 +1519,9 @@ def test_datetime_invalid_index(self, values, format):
15181519
r'^Given date string "a" not likely a datetime, at position 0$',
15191520
r'^time data "a" doesn\'t match format "%H:%M:%S", at position 0. '
15201521
f"{PARSING_ERR_MSG}$",
1521-
r'^unconverted data remains when parsing with format "%H:%M:%S": "9". '
1522-
f"{PARSING_ERR_MSG}$",
1523-
rf"^second must be in 0..59{NOT_99}: 00:01:99$",
1522+
r'^unconverted data remains when parsing with format "%H:%M:%S": "9", '
1523+
f"at position 0. {PARSING_ERR_MSG}$",
1524+
rf"^second must be in 0..59{NOT_99}: 00:01:99, at position 0$",
15241525
]
15251526
)
15261527
with pytest.raises(ValueError, match=msg):

0 commit comments

Comments
 (0)