| 4203 | current: list[trace.SpanContext] = [] |
| 4204 | |
| 4205 | def respond(_request: httpx2.Request) -> httpx2.Response: |
| 4206 | # What instrumentation of the HTTP client makes the parent of its own span. |
| 4207 | current.append(trace.get_current_span().get_span_context()) |
| 4208 | return httpx2.Response(500, json={}) if len(current) == 1 else httpx2.Response(200, json=MESSAGE) |
| 4209 | |
| 4210 | route = respx_mock.post("/v1/messages").mock(side_effect=respond) |
| 4211 | make: Callable[..., Any] = make_client if sync else make_async_client |