Commit 12ed44f
committed
test(plugins): assert error propagation in on_*_error fallback tests
The three on_*_error "fallback to runner" tests placed their only assertion
inside an `except` block with no guard, so they passed even when no error was
raised, the exact regression they exist to catch. The model-callback variant
only constructed InMemoryRunner (which never runs the agent), so it could
never raise and was fully vacuous.
Rewrite them to fail on a no-raise regression, matching existing repo
conventions:
- test_async/live_on_tool_error_fallback_to_runner: wrap the call in
`pytest.raises(ClientError)` and assert the raised error.
- test_on_model_error_callback_fallback_to_runner: run the agent and assert
the unhandled model error surfaces as a terminal error event
(error_code == 'ClientError'), mirroring the error-event assertions in
test_base_llm_flow.py.
No production code changes.1 parent e6df097 commit 12ed44f
2 files changed
Lines changed: 11 additions & 11 deletions
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | | - | |
186 | | - | |
| 185 | + | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
261 | | - | |
| 260 | + | |
262 | 261 | | |
263 | | - | |
264 | | - | |
| 262 | + | |
265 | 263 | | |
266 | 264 | | |
267 | 265 | | |
| |||
0 commit comments