(_request: httpx2.Request)
| 2812 | nb_retries = 0 |
| 2813 | |
| 2814 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 2815 | nonlocal nb_retries |
| 2816 | if nb_retries < failures_before_success: |
| 2817 | nb_retries += 1 |
| 2818 | if failure_mode == "exception": |
| 2819 | raise RuntimeError("oops") |
| 2820 | return httpx2.Response(500) |
| 2821 | return httpx2.Response(200) |
| 2822 | |
| 2823 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 2824 |
nothing calls this directly
no outgoing calls
no test coverage detected