pytest-freezer
Pytest plugin providing a fixture interface for spulec/freezegun
Decision gist · record as of 2026-08-14
Yes. If your test suite includes time-dependent code, pytest-freezer eliminates the friction of managing freezegun contexts manually. The fixture interface is cleaner than raw freezegun, install friction is minimal, and the MIT license poses no restrictions. Maintenance is dormant but the package is stable and narrow in scope—there is little that can break. Install it when you need time control in pytest tests.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation as a pure-Python wheel.
- Maintenance is dormant—the last release was 610 days ago—but the repository remains active and the package is stable enough for its narrow use case.
License · maintenance · safety
permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
last release 2024-12-12 (610 days) · last repo commit 2024-12-12 · 57 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,383,989 downloads/mo, #3,979 on PyPI
Alternatives
Verify before relying
pip install pytest-freezer
import pytest
from datetime import datetime
def test_frozen_date(freezer):
now = datetime.now()
freezer.move_to("2022-10-17")
assert datetime.now().date().isoformat() == "2022-10-17"- Whether the package actively addresses pytest or freezegun API changes in newer releases
- Compatibility with pytest versions beyond the current major release
What it is and what it does
pytest-freezer wraps freezegun as a pytest fixture, letting you freeze and manipulate system time within test functions. Instead of manually managing freezegun contexts, you inject the `freezer` fixture into your test and call methods like `move_to()` and `tick()` to advance or set the clock. Time is frozen by default when the fixture is active, so datetime calls return consistent values across a test—useful for testing time-sensitive logic without waiting for real time to pass or dealing with flaky tests that depend on wall-clock timing.
The package depends on pytest and freezegun, both of which are widely used in the Python ecosystem. It requires Python 3.6 or later and is classified as a testing framework plugin. With low install friction and no known vulnerabilities, it is a straightforward addition to test suites that need deterministic time control.
Use it for
- Test code that checks expiration dates or time-based conditions without waiting for real time to elapse
- Verify scheduled task or cron-like behavior by advancing the clock to specific dates and times
- Ensure datetime-dependent calculations produce consistent results across test runs
- Test retry logic or timeout behavior by controlling how much time passes between operations
- Validate time-zone-aware datetime handling in isolation from the system clock
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
If your test suite includes time-dependent code, pytest-freezer eliminates the friction of managing freezegun contexts manually. The fixture interface is cleaner than raw freezegun, install friction is minimal, and the MIT license poses no restrictions. Maintenance is dormant but the package is stable and narrow in scope—there is little that can break. Install it when you need time control in pytest tests.
Install
pytest-freezer on PyPI
Before you install
Low friction installation as a pure-Python wheel. Maintenance is dormant—the last release was 610 days ago—but the repository remains active and the package is stable enough for its narrow use case.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
pip install pytest-freezer
import pytest
from datetime import datetime
def test_frozen_date(freezer):
now = datetime.now()
freezer.move_to("2022-10-17")
assert datetime.now().date().isoformat() == "2022-10-17"
Verify before relying
- Whether the package actively addresses pytest or freezegun API changes in newer releases
- Compatibility with pytest versions beyond the current major release
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespytestfreezegun |
| Maintenance | Dormant 610 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,383,989 / month, #3,979 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: PytestLicense :: OSI Approved :: MIT License |
Evidence: pytest_freezer-0.4.9-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest time mocking”
- pytest-freezerpytest-freezer provides a pytest fixture that freezes system time…
- pytest-freezegunpytest-freezegun provides a pytest plugin that freezes time in tests…
- time-machineMocks and freezes time in tests, allowing you to travel to any point…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also Frozen-Flask · pytest-freezegun · time-machine · freezegun · pytest-pgsql · looptime · pytest-httpbin · pytest-rng · pytest-mock · pytest-durations