Overview
RDK provides several mechanisms for testing LLM applications:mode="test"— disables HTTP transport (null transport)enabled=False— disables tracing entirelycapture_traces()— captures spans in memory for assertions
Test mode
mode="test" sets transport="null" — no HTTP calls are made.
RDK_MODE=test environment variable.
enabled=False
When you don’t want any tracing at all:pytest fixture
A standard fixture that initializes RDK in test mode and tears down after each test:capture_traces()
Assert on the spans that were created during a function call:Check token usage
InMemoryTransport
For lower-level assertions, useInMemoryTransport directly:
Environment variable approach
SetRDK_MODE=test in your test environment to enable test mode without changing code:
See Also
- init() —
modeandenabledparameters

