MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_propagation_env

Function test_propagation_env

tests/test_tracing.py:266–282  ·  view source on GitHub ↗
(
    new_client: NewClient,
    propagator: CountingPropagator,
    monkeypatch: pytest.MonkeyPatch,
    env: str,
    option: OpenTelemetryClientOption,
    propagation: bool,
)

Source from the content-addressed store, hash-verified

264 ],
265)
266async def test_propagation_env(
267 new_client: NewClient,
268 propagator: CountingPropagator,
269 monkeypatch: pytest.MonkeyPatch,
270 env: str,
271 option: OpenTelemetryClientOption,
272 propagation: bool,
273) -> None:
274 monkeypatch.setenv(PROPAGATION_ENV, env)
275 server = Server(retried=True)
276 client = new_client(server, open_telemetry=option)
277
278 await call(client)
279
280 assert client.open_telemetry["propagation"] is propagation
281 assert server.traceparents == ([TRACEPARENT, TRACEPARENT] if propagation else [None, None])
282 assert (propagator.injected > 0) is propagation
283
284
285def test_copy_keeps_propagation(new_client: NewClient) -> None:

Callers

nothing calls this directly

Calls 3

ServerClass · 0.85
new_clientFunction · 0.85
callFunction · 0.70

Tested by

no test coverage detected