Sample
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
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- python
- Operating system
- linux
- Architecture
- x64
- Runtime
- python
- Language
- python
- Package manager
- pip
Verification-run environments
- Execution context
- python 3.12
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- python 3.12
- Language
- python
- Package manager
- pip
- Execution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Case
- Goal
- 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
- Packages
-
freezegun 1.5.5
python-dateutil 2.9.0.post0
six 1.17.0
- Environment
- python
- Created
- 2026-08-17T13:37:37Z
Contract
- 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
Files
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/session_manager.py
- test/contract.py
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9