Frontend Frameworks

freezegun

Mock datetime for testing time-sensitive code.

Status
Not yet determined
Last checked
Checked · Oct 16, 2026
License
Open source
Pricing
Free tier · from $0

What it is

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.

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.

When it fits — and when it doesn’t

A good fit 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.

Look elsewhere if

  • Projects that do not require mocking of the datetime module for testing purposes.

  • Developers looking for a solution beyond Python's ecosystem.

Known weaknesses

Each one links to the public issue, changelog or docs page it came from, where we have one.

  1. 01

    Limited to Python environments

    Freezegun is specifically designed for Python and does not support other programming languages, which limits its utility in polyglot development teams.

  2. 02

    Potential for unexpected behavior with complex datetime manipulations

    When mocking datetime in complex applications with intricate time-based logic, Freezegun might not cover all edge cases leading to inconsistent test results.

  3. 03

    Does not automatically mock third-party libraries using datetime

    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.

  4. 04

    Performance overhead during test execution

    Mocking the datetime module can introduce additional overhead in tests, particularly when used extensively across a large suite of tests.

What it does well

  • Freeze time to a specific point for testing purposes.

  • Supports mocking of datetime, date, and time classes.

  • Easy integration with popular Python testing frameworks.

Pricing

Free tier
YesOpen source — free to use
Paid from
$0
Model
Flat rate
Enterprise plan
No

Pricing not independently confirmed — check the vendor’s page.

Performance benchmarks

How Fast Is It?

Set up freezegun

Setup steps, common gotchas and what to check after 30 days.

Open the setup guide →
Get the badge

A small badge for freezegun’s README or site: its name, “Tracked on AI Navigator”, and the availability status and check month from this page. It updates as the catalog does.

freezegun — tracked on AI Navigator

Markdown

[![freezegun — tracked on AI Navigator](https://navigateaitools.com/badge/freezegun.svg)](https://navigateaitools.com/explorer/tool/freezegun)

HTML

<a href="https://navigateaitools.com/explorer/tool/freezegun"><img src="https://navigateaitools.com/badge/freezegun.svg" alt="freezegun — tracked on AI Navigator" height="58"></a>