Freezegun - python mocking time for testing. Timetravel be aware

Опубликовано: 11 Март 2026
на канале: InvalidEntry
559
14

This is one of the libraries which my office loves - the difficulty of writing consistent unit tests when time is involved: things are always changing, how do you get the same output twice: well, freezegun. It locks the output from datetime in a super-easy way - much easier than mocking, and because it's so easy, it's one of those things that I think people should know and use.

Its libraries like this one save us so many hours, it improves the quality of the code, and makes our life better. That's what I love about open-source community which is when you get something of quality and everyone benefits.