Ejemplo
Control frozen time programmatically with freeze_time via tick and move_to, handle timezone offsets, nested contexts, and standard datetime inheritance in freezegun 1.5.5
sha256:37f274f3e232a58a899ff5a81d9c660a9fa7324398d1b2731d0e5b454eef1bb6
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- python
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- python
- Lenguaje
- python
- Gestor de paquetes
- pip
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- python 3.12
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- python 3.12
- Lenguaje
- python
- Gestor de paquetes
- pip
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Caso
- Objetivo
- Control frozen time programmatically with freeze_time via tick and move_to, handle timezone offsets, nested contexts, and standard datetime inheritance in freezegun 1.5.5 HOW
- Paquetes
-
freezegun 1.5.5
python-dateutil 2.9.0.post0
six 1.17.0
- Entorno
- python
- Creado
- 2026-08-17T13:37:37Z
Contrato
- assert freeze_time context manager enables programmatic clock manipulation via move_to and tick, applies tz_offset strictly to local time without altering UTC, and restores outer scopes upon exit
- assert calling tick() without arguments advances the frozen clock by exactly 1 second while tick(delta) supports int, float, and timedelta increments
- assert move_to() immediately updates datetime.datetime.now() and datetime.datetime.utcnow() to the specified string, datetime, or date target
- assert tz_offset shifts datetime.datetime.now() while datetime.datetime.utcnow() and time.time() remain bound to the unshifted UTC timestamp
- assert nested freeze_time context managers cleanly override the frozen clock in inner blocks and restore outer frozen state on exit
- assert FakeDatetime and FakeDate instances returned during time freezing maintain full inheritance and isinstance compatibility with datetime.datetime and datetime.date
Archivos
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/session_manager.py
- test/contract.py
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9