|
62 | 62 | NOT_99 = ", not 99" |
63 | 63 | DAY_IS_OUT_OF_RANGE = ( |
64 | 64 | 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" |
65 | 66 | ) |
66 | 67 | else: |
67 | 68 | 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" |
69 | 70 |
|
70 | 71 |
|
71 | 72 | pytestmark = pytest.mark.filterwarnings( |
@@ -1459,10 +1460,10 @@ def test_datetime_invalid_scalar(self, value, format): |
1459 | 1460 | [ |
1460 | 1461 | r'^time data "a" doesn\'t match format "%H:%M:%S", at position 0. ' |
1461 | 1462 | 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$", |
1466 | 1467 | ] |
1467 | 1468 | ) |
1468 | 1469 | with pytest.raises(ValueError, match=msg): |
@@ -1518,9 +1519,9 @@ def test_datetime_invalid_index(self, values, format): |
1518 | 1519 | r'^Given date string "a" not likely a datetime, at position 0$', |
1519 | 1520 | r'^time data "a" doesn\'t match format "%H:%M:%S", at position 0. ' |
1520 | 1521 | 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$", |
1524 | 1525 | ] |
1525 | 1526 | ) |
1526 | 1527 | with pytest.raises(ValueError, match=msg): |
|
0 commit comments