pytest Plugin¶
pytest plugin for russo — auto-discovered via the pytest11 entry point.
pytest_plugin
¶
pytest plugin for russo — auto-discovered via the pytest11 entry point.
Provides:
- russo marker for declarative test scenarios
- russo_result fixture that runs the full pipeline
- Terminal summary via pytest_terminal_summary hook
- --russo-report CLI option for HTML report output
- --russo-runs for concurrent multi-run testing
pytest_sessionstart
¶
Clear audio cache if --russo-clear-cache was passed.
Source code in src/russo/pytest_plugin.py
russo_audio_cache
¶
russo_audio_cache(request: FixtureRequest) -> AudioCache
Session-scoped audio cache. Override in conftest.py to customize.
Source code in src/russo/pytest_plugin.py
russo_evaluator
¶
russo_evaluator() -> ExactEvaluator
russo_result
async
¶
russo_result(request: FixtureRequest) -> EvalResult | BatchResult | None
Run the russo pipeline based on the @pytest.mark.russo marker.
Reads marker kwargs, resolves synthesizer/agent/evaluator fixtures, runs the pipeline, and returns the result.
Marker kwargs
prompt (str): Single text prompt.
prompts (list[str]): Multiple text prompts (runs all concurrently).
expect (list): Expected tool calls.
runs (int): Number of times to run each prompt (default 1).
Falls back to --russo-runs CLI option.
max_concurrency (int | None): Cap on concurrent runs.
Falls back to --russo-max-concurrency CLI option.
| RETURNS | DESCRIPTION |
|---|---|
EvalResult | BatchResult | None
|
|
EvalResult | BatchResult | None
|
|
EvalResult | BatchResult | None
|
|
Source code in src/russo/pytest_plugin.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
pytest_terminal_summary
¶
Print russo results summary at the end of the test run.
Source code in src/russo/pytest_plugin.py
pytest_sessionfinish
¶
Reset global reporter state between sessions (relevant for xdist, etc.).