サンプル
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
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- python
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- python
- 言語
- python
- パッケージマネージャー
- pip
検証実行環境
- 実行コンテキスト
- python 3.12
- OS
- linux alpine · musl
- アーキテクチャ
- x64
- ランタイム
- python 3.12
- 言語
- python
- パッケージマネージャー
- pip
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
ケース
- ゴール
- 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
- パッケージ
-
freezegun 1.5.5
python-dateutil 2.9.0.post0
six 1.17.0
- 環境
- python
- 作成日
- 2026-08-17T13:37:37Z
コントラクト
- 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
ファイル
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/session_manager.py
- test/contract.py
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9