Skip to content

Latest commit

 

History

History
36 lines (10 loc) · 298 Bytes

File metadata and controls

36 lines (10 loc) · 298 Bytes

Pytest Recipes

Copy‑paste patterns for common scenarios.

Monkeypatch environment

Temporary working directory

Mock function call (pytest-mock)

Capture logs

Parametrized error cases

Async with timeout

HTTP client (httpx)

Database (sqlite) in tmp