--- id: freezegun version: "1.5.5" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # freezegun — Let your Python tests travel through time License: permissive · Maintenance: aging · Popularity: top 1,000 on PyPI ## Install pip install freezegun uv add freezegun poetry add freezegun ## Description FreezeGun: Let your Python tests travel through time ==================================================== .. image:: https://img.shields.io/pypi/v/freezegun.svg :target: https://pypi.python.org/pypi/freezegun/ .. image:: https://github.com/spulec/freezegun/workflows/CI/badge.svg :target: https://github.com/spulec/freezegun/actions .. image:: https://coveralls.io/repos/spulec/freezegun/badge.svg?branch=master :target: https://coveralls.io/r/spulec/freezegun FreezeGun is a library that allows your Python tests to travel through time by mocking the datetime module. Usage ----- Once the decorator or context manager have been invoked, all calls to datetime.datetime.now(), datetime.datetime.utcnow(), datetime.date.today(), time.time(), time.localtime(), time.gmtime(), and time.strftime() will return the time that has been frozen. time.monotonic() and time.perf_counter() will also be frozen, but as usual it makes no guarantees about their absolute value, only their changes over time. Decorator ~~~~~~~~~ .. code-block:: python from freezegun import freeze_time import datetime import unittest # Freeze time for a pytest style test:... ## AI interpretation — verify before relying FreezeGun mocks Python's datetime and time modules to let tests control the current time, enabling you to test time-dependent code without waiting or dealing with real clock progression. Verdict: FreezeGun is a mature, well-maintained testing utility with no known vulnerabilities and permissive licensing. Its single lightweight dependency and broad Python 3.8+ support make it low-risk to adopt. The aging maintenance status (369 days since last release) is typical for stable libraries and does not indicate abandonment given recent repository activity. [View on SkillFed](https://skillfed.io/packages/freezegun) · [View on PyPI](https://pypi.org/project/freezegun/)