I recently released python-libfaketime, which makes it easy to mock the current time during tests. It’s also two orders of magnitude faster than freezegun on my laptop. This is because instead of searching for and monkeypatching imported python stdlib modules, python-libfaketime uses libfaketime to intercept c standard library calls.
Here’s how it works:
The second step is seamless to end users, but the first step can be annoying. To make this easier, python-libfaketime provides a function to modify the environment and re-exec the current process.
Give it a try if you notice slow tests while using freezegun – it made the Venmo test suite about 20% faster.