(_request: httpx2.Request)
| 2846 | nb_retries = 0 |
| 2847 | |
| 2848 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 2849 | nonlocal nb_retries |
| 2850 | if nb_retries < failures_before_success: |
| 2851 | nb_retries += 1 |
| 2852 | if failure_mode == "exception": |
| 2853 | raise RuntimeError("oops") |
| 2854 | return httpx2.Response(500) |
| 2855 | return httpx2.Response(200) |
| 2856 | |
| 2857 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 2858 |
nothing calls this directly
no outgoing calls
no test coverage detected