Skip to content

Commit

Permalink
Move and rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Sep 19, 2023
1 parent b8aa4ea commit 1e3a11d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/test_time_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,24 @@ def test_destination_date():
assert time.time() == EPOCH


def test_destination_timedelta():
now = time.time()
with time_machine.travel(dt.timedelta(seconds=3600)):
assert now + 3600 <= time.time() <= now + 3601


def test_destination_timedelta_negative():
now = time.time()
with time_machine.travel(dt.timedelta(seconds=-3600)):
assert now - 3600 <= time.time() <= now - 3599


def test_destination_timedelta_nested():
with time_machine.travel(EPOCH):
with time_machine.travel(dt.timedelta(seconds=10)):
assert time.time() == EPOCH + 10.0


@time_machine.travel("1970-01-01 00:01 +0000")
def test_destination_string():
assert time.time() == EPOCH + 60.0
Expand All @@ -464,24 +482,6 @@ def test_destination_generator():
assert time.time() == EPOCH + 13.0


def test_destination_delta():
now = time.time()
with time_machine.travel(dt.timedelta(seconds=3600)):
assert now + 3600 <= time.time() <= now + 3601


def test_destination_negative_delta():
now = time.time()
with time_machine.travel(dt.timedelta(seconds=-3600)):
assert now - 3600 <= time.time() <= now - 3599


def test_destination_delta_raises():
with time_machine.travel(EPOCH):
with time_machine.travel(dt.timedelta(seconds=10)):
assert time.time() == EPOCH + 10.0


def test_traveller_object():
traveller = time_machine.travel(EPOCH + 10.0)
assert time.time() >= LIBRARY_EPOCH
Expand Down

0 comments on commit 1e3a11d

Please sign in to comment.