Skip to content

Commit

Permalink
Add test for ignores on date.today/datetime.now
Browse files Browse the repository at this point in the history
  • Loading branch information
immerrr committed Dec 1, 2021
1 parent 8994558 commit 5c305e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ def test_should_use_real_time():

with freeze_time(frozen):
assert time.time() == expected_frozen
assert datetime.datetime.now() == frozen
assert datetime.date.today() == frozen.date()
# assert time.localtime() == expected_frozen_local
assert time.gmtime() == expected_frozen_gmt
if HAS_CLOCK:
Expand All @@ -726,6 +728,8 @@ def test_should_use_real_time():

with freeze_time(frozen, ignore=['_pytest']):
assert time.time() != expected_frozen
assert datetime.datetime.now() != frozen
assert datetime.date.today() != frozen.date()
# assert time.localtime() != expected_frozen_local
assert time.gmtime() != expected_frozen_gmt
if HAS_CLOCK:
Expand Down

0 comments on commit 5c305e6

Please sign in to comment.