(_request: httpx2.Request)
| 3209 | nb_retries = 0 |
| 3210 | |
| 3211 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 3212 | nonlocal nb_retries |
| 3213 | if nb_retries < failures_before_success: |
| 3214 | nb_retries += 1 |
| 3215 | if failure_mode == "exception": |
| 3216 | raise RuntimeError("oops") |
| 3217 | return httpx2.Response(500) |
| 3218 | return httpx2.Response(200) |
| 3219 | |
| 3220 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 3221 |
nothing calls this directly
no outgoing calls
no test coverage detected