Skip to content

Commit

Permalink
tests: Fix broken assumption for leap year
Browse files Browse the repository at this point in the history
Fixes: #22
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Mar 1, 2023
1 parent cca753a commit 66540d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tempora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ def parse_timedelta(str):
Note that months and years strict intervals, not aligned
to a calendar:
>>> now = datetime.datetime.now()
>>> later = now + parse_timedelta('1 year')
>>> diff = later.replace(year=now.year) - now
>>> date = datetime.datetime.fromisoformat('2000-01-01')
>>> later = date + parse_timedelta('1 year')
>>> diff = later.replace(year=date.year) - date
>>> diff.seconds
20940
Expand Down

0 comments on commit 66540d2

Please sign in to comment.