Skip to content
Open
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: 9 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ def test_from_timestamp_with_negative_value():

def test_from_timestamp_with_overflow_value():
value = 9223372036854775
with pytest.raises(ValueError, match=r"out of range|year must be in 1\.\.9999"):
# The error message varies by platform:
# - Linux: ValueError("year must be in 1..9999") (not caught by from_timestamp)
# - Some platforms: ValueError("... out of range") (not caught by from_timestamp)
# - Some platforms: OverflowError -> ValueError("Timestamp is too large")
# - Windows: OSError -> ValueError("Error converting value to datetime")
with pytest.raises(
ValueError,
match=r"out of range|year must be in 1\.\.9999|Timestamp is too large|Error converting value to datetime",
):
utils.from_timestamp(value)


Expand Down