Nesting freeze_time doesn't work with time.time()
See original GitHub issue@freeze_time('2015-01-01')
def test_method(self):
print time(), datetime.utcnow()
with freeze_time('2015-01-01T00:06:00'):
print time(), datetime.utcnow()
Yields:
1420070400.0 2015-01-01 00:00:00
1420070400.0 2015-01-01 00:06:00
$ pip show freezegun
---
Name: freezegun
Version: 0.3.5
Location: /home/____/paxon/env/lib/python2.7/site-packages
Requires: six, python-dateutil
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:9 (4 by maintainers)
Top Results From Across the Web
how to use freezegun on logbook - Stack Overflow
I'm trying to run tests that involve mocking datetime within logbook (for logic around logbook.TimedRotatingFileHandler ). But freezegun doesn't ...
Read more >Scheduling: setTimeout and setInterval
Nested setTimeout calls are a more flexible alternative to setInterval , allowing us to set the time between executions more precisely. Zero ...
Read more >Time-stretching and time-remapping - Adobe Support
In a Composition or Timeline panel, select the layer. Place the current-time indicator on the frame that you want to freeze.
Read more >Troubleshoot strange heating or cooling behavior
If your system doesn't work correctly with your old thermostat and you see the same issues you had with the Nest thermostat, your...
Read more >setTimeout() - Web APIs - MDN Web Docs
Working with asynchronous functions ... setTimeout() is an asynchronous function, meaning that the timer function will not pause execution of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
From a very cursory inspection of api.py it looks like this is the start of the problem:
and later
The nesting works because the second block, which is not implemented for the birst blocks. It looks like the code could be simplified a lot if this was unified too, so instead of
you could have
or similar but better named obviously.
Closed with #260