v0.4.0
Highlights
-
Inspectorclass - stateful wrapper that accumulates violations across
all connections. Unlikeinspect()(which returns a plain callable with no
way to read results),Inspectorkeeps a.violationslist you can assert
on after driving the app:inspector = Inspector(app) # ... drive the app with httpx, TestClient, etc. ... assert inspector.violations == []
Inspectoris also directly callable as an ASGI app. -
User-defined profiles - define reusable rule presets in
pyproject.toml
or.asgion.tomland reference them by name in config or CLI:[tool.asgion.profiles.ci] min_severity = "error" categories = ["http.fsm", "ws.fsm"]
asgion check myapp:app --profile ci
-
inspect()is now a thin wrapper aroundInspector- no behavior change,
fully backward-compatible.
Breaking Changes
-
InspectedApp(internal class inasgion.pytest_plugin) is replaced by
Inspector. If you annotated the return type ofasgi_inspectexplicitly,
update it:# before app: InspectedApp = asgi_inspect(my_app) # after from asgion import Inspector app: Inspector = asgi_inspect(my_app)
Existing test code that only accesses
.violationsor callsapp(...)works
without changes.
Full changelog: CHANGELOG.md