Install varianz-pytest (instructions) and the plugin auto-registers via entry points — no conftest.py changes needed. Run pytest with the standard environment: VARIANZ_ENABLED=true, plus VARIANZ_INSECURE_ALLOW_PLAINTEXT=true for a plaintext local registry.
Endpoint: defaults to http://localhost:50051; override with --varianz-endpoint <url> or VARIANZ_REGISTRY_ADDR.
The varianz fixture
A fresh VarianzSession per test, with automatic stage cleanup:
Python’s requests strips custom headers when following redirects. Always use a requests.Session() with x-varianz-id set on the session object, not per-call headers=.
Session API
Sample assertions
In-process calls
When the code under test runs in the same process as pytest (not behind HTTP/gRPC), activate the session on the current context before calling it:
For creating stages, cel(target, expression) is the only constructor you need — targets and routing filters are described in Naming and routing.