Skip to content

Commit

Permalink
TST: Add test for largest possible timedelta
Browse files Browse the repository at this point in the history
Should be able to handle a 999,999,999 day timedelta because that is the
max allowed for the datetime library.
  • Loading branch information
carterbox committed Dec 30, 2021
1 parent c7ce67e commit 818fd1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def test_naturaldelta_nomonths(test_input, expected):
(dt.timedelta(days=9), "9 days"),
(dt.timedelta(days=365), "a year"),
(dt.timedelta(days=365 * 1_141), "1,141 years"),
("NaN", "NaN"),
("NaN", "NaN"), # Returns non-numbers unchanged.
# largest possible timedelta
(dt.timedelta(days=999_999_999), "2,739,726 years"),
],
)
def test_naturaldelta(test_input, expected):
Expand Down

0 comments on commit 818fd1d

Please sign in to comment.