There was an error while loading. Please reload this page.
1 parent ac55bbb commit ca10a45Copy full SHA for ca10a45
1 file changed
tests/test_time.py
@@ -145,14 +145,14 @@ def test_naturaldelta_non_finite_floats() -> None:
145
timedelta(seconds=value). They should be returned as strings, like float("nan").
146
A legitimately too-large *finite* float must still raise OverflowError.
147
"""
148
- import math
149
# Non-finite values return the string repr
150
assert humanize.naturaldelta(float("inf")) == "inf"
151
assert humanize.naturaldelta(float("-inf")) == "-inf"
152
# NaN already worked before; confirm it still does
153
assert humanize.naturaldelta(float("nan")) == "nan"
154
# A truly too-large finite float must still raise (documented behaviour)
155
import pytest
+
156
with pytest.raises(OverflowError):
157
humanize.naturaldelta(1e308 * 10)
158
0 commit comments