샘플
Configure httpx timeouts across connect, read, write, and pool phases without falling for requests-style unbounded defaults, partial kwarg ValueError traps, or 2-tuple unlimited-write surprises
sha256:1ddf2062ed8d42a754be36dfc77a7d14fc9f7b8e095bca0e0a8323388c1e63dd
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Configure httpx timeouts across connect, read, write, and pool phases without falling for requests-style unbounded defaults, partial kwarg ValueError traps, or 2-tuple unlimited-write surprises HOW
- 패키지
- httpx 0.28.1
- 환경
- python
- 생성일
- 2026-08-15T08:26:26Z
컨트랙트
- assert httpx.Client default timeout is 5.0 seconds across all 4 phases (connect, read, write, pool), unlike requests which defaults to None
- assert httpx.Timeout() with no arguments raises ValueError rather than returning the 5.0 default configuration
- assert httpx.Timeout(read=10.0) raises ValueError without a positional default argument or all four explicit kwargs
- assert httpx.Timeout(5.0, read=10.0) sets read to 10.0 and keeps connect, write, and pool at 5.0
- assert passing a 2-tuple (connect, read) sets write and pool to None (unlimited), not 5.0
- assert passing a 4-tuple sets connect, read, write, and pool in explicit positional order
- assert timeout=None at the request level explicitly disables all timeouts even when the client has a positive timeout configured
- assert request.extensions['timeout'] carries the resolved 4-phase dictionary into the transport layer
- assert ConnectTimeout, ReadTimeout, WriteTimeout, and PoolTimeout all subclass TimeoutException and RequestError, but not HTTPStatusError
파일
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- src/__init__.py
- src/timeouts.py
- test/__init__.py
- test/contract.py
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-15 · ed25519:ac1544ece1e22594