spulec/freezegun
Let your Python tests travel through time observed · 2026-08-28
Health v2 · maintenance only
51/100
- Activity 37
- Release rhythm 42
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 17
- age_days: 5013
- days_rel: 389
- days_push: 379
- n_releases_24m: 4
Adoption not part of the score
4525 stars · 301 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
FreezeGun is a Python library that lets tests 'travel through time' by mocking datetime and time module functions. It provides a decorator and context manager to freeze the clock at a fixed moment during test execution.
Use cases
- test code that depends on the current date or time
- freeze datetime.now() in pytest tests
- mock time.time() for deterministic unit tests
- simulate deadlines and expiry logic in tests
- test time-based scheduling behavior deterministically
When to choose
- your Python tests need deterministic control over datetime or time functions
- you use pytest or unittest and want a decorator/context-manager API
- you need to test expiry, scheduling, or date-dependent logic
When to avoid
- you need to mock time in non-Python languages
- you need full control over monotonic clock semantics beyond what freezegun guarantees
- your code uses time sources freezegun does not patch
Facets
library · maturity stable
testing mocking date-time testing developer-tools python cross-platform time-mocking pytest unittest datetime
2 sources
- readme: https://github.com/spulec/freezegun · fetched 2026-08-28 · 59e5e3bc5741
- registry_pypi: https://pypi.org/pypi/freezegun/json · fetched 2026-08-29 · 6ec14ea1419a
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| spulec/freezegun | main | 51 |
For agents
markdown · JSON · MCP: product_card(name="spulec/freezegun")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem