pytest — assert_run
The pytest plugin auto-loads (via the pytest11 entry point) once
clousight-bench is installed — no conftest wiring. Call assert_run in any
test; it runs one suite and raises AssertionError unless the run completes
and every threshold is met:
clousight fixture:
target defaults to {"mode": "mock"} (the offline path), so a gate runs in CI
with no cloud account; point it at a real endpoint/service to gate production.
CI without pytest — csbench run --assert
Threshold model
Measurements are heterogeneous (accuracy is higher-is-better; latency/cost are lower-is-better), so a threshold declares a direction:
A gated key that the run did not measure is a failure. The same model backs both
assert_run (pytest) and csbench run --assert (CI exit code).