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

Function error_logs

tests/lib/test_refusal_fallback_streaming.py:37–43  ·  view source on GitHub ↗

Messages the middleware logged at ERROR — refusals surfaced rather than retried.

(caplog: pytest.LogCaptureFixture)

Source from the content-addressed store, hash-verified

35
36
37def error_logs(caplog: pytest.LogCaptureFixture) -> list[str]:
38 """Messages the middleware logged at ERROR — refusals surfaced rather than retried."""
39 return [
40 record.getMessage()
41 for record in caplog.records
42 if record.name == LOGGER_NAME and record.levelno >= logging.ERROR
43 ]
44
45
46FIXTURES = Path(__file__).parent.parent / "fixtures" / "fable-fallback"

Calls

no outgoing calls

Tested by

no test coverage detected