freezegun
Mock datetime for testing time-sensitive code.
Pricing
Free tier
Flat rate
Adoption
↘CoolingLicense
Open Source
Data freshness
Aging · Jun 8, 2026Overview
What is freezegun?
FreezeGun allows developers to mock the datetime module in Python, making it easier to test and develop applications that depend on specific points in time. This is particularly useful for ensuring consistent behavior across different environments or times.
Key differentiator
“FreezeGun stands out as an easy-to-use library specifically designed to mock the datetime module in Python, making it ideal for developers who need precise control over time-related tests without altering system-wide settings.”
Capability profile
Capability Radar
Honest assessment
Strengths & Weaknesses
↑ Strengths
↓ Weaknesses
Freezegun is specifically designed for Python and does not support other programming languages, which limits its utility in polyglot development teams.
When mocking datetime in complex applications with intricate time-based logic, Freezegun might not cover all edge cases leading to inconsistent test results.
If an application relies on external libraries that also use the datetime module, these must be manually mocked or configured to work with Freezegun, adding complexity.
Mocking the datetime module can introduce additional overhead in tests, particularly when used extensively across a large suite of tests.
Fit analysis
Who is it for?
✓ Best for
Python developers who need to test time-sensitive code without changing system-wide settings.
Teams working on projects where consistent date and time behavior is crucial across different environments.
✕ Not a fit for
Projects that do not require mocking of the datetime module for testing purposes.
Developers looking for a solution beyond Python's ecosystem.
Cost structure
Pricing
Free Tier
Available
Open source — free to use
Starts at
$0
Model
Flat rate
Enterprise
None
Performance benchmarks
How Fast Is It?
Ecosystem
Relationships
Next step
Get Started with freezegun
Step-by-step setup guide with code examples and common gotchas.