time-machine
Travel through time in your tests.
Travel through time in your tests.
To install this package, run one of the following:
time-machine is intended to combine the advantages of freezegun and libfaketime. It works without LD_PRELOAD but still mocks the standard library functions everywhere they may be referenced. It does so by modifying the built-in functions at the C level, to point them through wrappers that return different values when mocking. Normally in Python, built-in functions are immutable, but time-machine overcomes this by using C code to replace their function pointers.
Summary
Travel through time in your tests.
Information Last Updated
Sep 8, 2025 at 17:33
License
MIT
Total Downloads
8
GitHub Repository
https://github.com/adamchainz/time-machine