Skip to content

Commit 818fd1d

Browse files
committed
TST: Add test for largest possible timedelta
Should be able to handle a 999,999,999 day timedelta because that is the max allowed for the datetime library.
1 parent c7ce67e commit 818fd1d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_time.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def test_naturaldelta_nomonths(test_input, expected):
119119
(dt.timedelta(days=9), "9 days"),
120120
(dt.timedelta(days=365), "a year"),
121121
(dt.timedelta(days=365 * 1_141), "1,141 years"),
122-
("NaN", "NaN"),
122+
("NaN", "NaN"), # Returns non-numbers unchanged.
123+
# largest possible timedelta
124+
(dt.timedelta(days=999_999_999), "2,739,726 years"),
123125
],
124126
)
125127
def test_naturaldelta(test_input, expected):

0 commit comments

Comments
 (0)