Beispiel
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
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- python
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- python
- Sprache
- python
- Paketmanager
- pip
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- python 3.12
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- python 3.12
- Sprache
- python
- Paketmanager
- pip
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Fall
- Ziel
- 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
- Pakete
-
freezegun 1.5.5
python-dateutil 2.9.0.post0
six 1.17.0
- Umgebung
- python
- Erstellt
- 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
Dateien
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/session_manager.py
- test/contract.py
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9