MCPcopy
hub / github.com/Aider-AI/aider / test_context_window_error

Function test_context_window_error

tests/basic/test_exceptions.py:56–65  ·  view source on GitHub ↗

Test specific handling of ContextWindowExceededError

()

Source from the content-addressed store, hash-verified

54
55
56def test_context_window_error():
57 """Test specific handling of ContextWindowExceededError"""
58 ex = LiteLLMExceptions()
59 from litellm import ContextWindowExceededError
60
61 ctx_error = ContextWindowExceededError(
62 message="Context length exceeded", model="gpt-4", llm_provider="openai"
63 )
64 ex_info = ex.get_ex_info(ctx_error)
65 assert ex_info.retry is False
66
67
68def test_openrouter_error():

Callers

nothing calls this directly

Calls 2

get_ex_infoMethod · 0.95
LiteLLMExceptionsClass · 0.90

Tested by

no test coverage detected