freezegun

Mock datetime for testing time-sensitive code.

EstablishedOpen SourceLow lock-in

Pricing

See website

Flat rate

Adoption

Stable

License

Open Source

Data freshness

Overview

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

Strength Radar

Freeze time to a…Supports mocking…Easy integration…

Honest assessment

Strengths & Weaknesses

↑ Strengths

Freeze time to a specific point for testing purposes.

Supports mocking of datetime, date, and time classes.

Easy integration with popular Python testing frameworks.

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

None

Starts at

See website

Model

Flat rate

Enterprise

None

Performance benchmarks

How Fast Is It?

Ecosystem

Relationships

Alternatives

Next step

Get Started with freezegun

Step-by-step setup guide with code examples and common gotchas.

View Setup Guide →