Skip to content

Commit 8192edd

Browse files
committed
Update tests to handle differences across Python versions
1 parent b6f0b5e commit 8192edd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/test_dates.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,10 @@ def test_datetime_from_isoformat_fails_datetime_valueerror():
976976
dates.datetime_from_isoformat(bad_str)
977977

978978
# days out of range have their own error message, see issue 70647
979-
with pytest.raises(ValueError, match="^day is out of range for month"):
979+
with pytest.raises(
980+
ValueError,
981+
match=r"^(day is out of range for month|\('day must be in 1\.\.30', 32\)|day 32 must be in range 1\.\.30 for month 4 in year 2009)",
982+
):
980983
dates.datetime_from_isoformat("2009-04-32T24:00:00")
981984

982985

0 commit comments

Comments
 (0)