test: fix assertion error in timestamp_to_date invalid test
All checks were successful
Validate PR Title / validate (pull_request) Successful in 6s
CI / ci (pull_request) Successful in 28s

This commit is contained in:
2026-02-28 14:15:32 +00:00
parent 481828073c
commit b10df655e3

View File

@@ -16,7 +16,11 @@ def test_correct() -> None:
def test_invalid() -> None:
"""Test timestamp_to_date() with an invalid timestamp."""
allowed_errors: list[str] = [
"'str' object cannot be interpreted as an integer",
"argument must be int or float, not str"
]
timestamp: str = "hello"
with pytest.raises(TypeError) as excinfo:
timestamp_to_date(timestamp)
assert "'str' object cannot be interpreted as an integer" in str(excinfo.value)
assert str(excinfo.value) in allowed_errors