Skip to content

Commit

Permalink
Update test_datetimes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kingbuzzman authored Apr 16, 2024
1 parent 673adf0 commit 2436841
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,19 @@ def test_time_with_dst():

def test_manual_increment():
initial_datetime = datetime.datetime(year=1, month=7, day=12,
hour=15, minute=6, second=3)
hour=15, minute=6, second=3)
with freeze_time(initial_datetime) as frozen_datetime:
assert frozen_datetime() == initial_datetime

expected = initial_datetime + datetime.timedelta(seconds=1)
assert frozen_datetime.tick() == expected
assert frozen_datetime() == expected

expected = initial_datetime + datetime.timedelta(seconds=10)
expected = initial_datetime + datetime.timedelta(seconds=11)
assert frozen_datetime.tick(10) == expected
assert frozen_datetime() == expected

expected = initial_datetime + datetime.timedelta(seconds=21)
assert frozen_datetime.tick(delta=datetime.timedelta(seconds=10)) == expected
assert frozen_datetime() == expected

Expand Down

0 comments on commit 2436841

Please sign in to comment.