Capture real production HTTP traffic. Auto-generate integration tests.
pip install httrace- Install — add one line of middleware to your app
- Capture — real HTTP traffic is captured and sanitized in the background
- Generate —
httrace generatewrites pytest files directly into your repo
# FastAPI / Starlette
from httrace import HttraceCaptureMiddleware
app.add_middleware(
HttraceCaptureMiddleware,
api_key="ht_your_key_here",
service="my-api",
)# Flask / Django (WSGI)
from httrace import HttraceCaptureMiddleware
app = HttraceCaptureMiddleware(app, api_key="ht_your_key_here", service="my-api")Then generate tests:
httrace init # creates httrace.config.yaml
httrace generate # writes pytest files to tests/integration/
httrace status # shows endpoint coverage- Zero latency impact — fire-and-forget background queue
- Automatic PII sanitization (JWT, email, credit card, IBAN, phone, UUIDs)
- Deduplication — same endpoint shape captured once
- Session chain analysis — detects request dependencies
- Fixture inference — generates pytest setUp helpers from request bodies
MIT — see LICENSE.
The Httrace backend and test generation service are proprietary.