--- id: pytest-freezer version: "0.4.9" license: unclear license_treatment: permissive maintenance: dormant --- # pytest-freezer — Pytest plugin providing a fixture interface for spulec/freezegun License: permissive · Maintenance: dormant · Downloads: 1.4M/mo ## 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 above — verify before relying. pytest-freezer provides a pytest fixture that freezes system time during tests, allowing you to control the clock for reproducible time-dependent test scenarios. 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 pip install pytest-freezer uv add pytest-freezer poetry add pytest-freezer ## Installing pytest-freezer 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest time mocking, freeze time in tests, pytest datetime fixture, test time control, freezegun pytest plugin, mock system clock, deterministic time testing, testing-fixture, time-mocking [View on SkillFed](https://skillfed.io/packages/pytest-freezer) · [View on PyPI](https://pypi.org/project/pytest-freezer/)