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

Function registered

tests/test_open_telemetry.py:169–176  ·  view source on GitHub ↗

`spans`, with its provider registered with the OpenTelemetry API for this test, which a client that is given none uses. A client that is given a `tracer_provider` is given an option, so it reads no environment variable. The API registers a provider once for each process, so this sets what i

(spans: Spans, monkeypatch: pytest.MonkeyPatch)

Source from the content-addressed store, hash-verified

167
168@pytest.fixture
169def registered(spans: Spans, monkeypatch: pytest.MonkeyPatch) -> Spans:
170 """`spans`, with its provider registered with the OpenTelemetry API for this test, which a client that is given none uses.
171
172 A client that is given a `tracer_provider` is given an option, so it reads no environment variable. The API
173 registers a provider once for each process, so this sets what it would have registered and puts it back afterwards.
174 """
175 monkeypatch.setattr(trace, "_TRACER_PROVIDER", spans.provider)
176 return spans
177
178
179def make_client(spans: Spans, **options: Any) -> Anthropic:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected