mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
test(router): assert the context-window error reports the deployment's own count
This commit is contained in:
parent
1805dc0ea5
commit
198b31b9d5
2 changed files with 4 additions and 2 deletions
|
|
@ -185,7 +185,7 @@ ignored_function_names = [
|
|||
"_pre_call_check_token_count", # Run by _pre_call_check_token_counts, tested through the per-deployment pre-call check tests in test_router.py
|
||||
"_pre_call_check_token_counts", # Run by _pre_call_checks and _acount_pre_call_check_tokens, tested through the pre-call check tests in test_router.py
|
||||
"_resolve_pre_call_check_token_counts", # Run by _pre_call_checks, tested through the precounted and inline pre-call check tests in test_router.py
|
||||
"_context_window_exceeded_line", # Builds the ContextWindowExceededError text, tested through the Got= assertions in test_router.py
|
||||
"_context_window_exceeded_line", # Builds the ContextWindowExceededError text, tested through the stand-in margin refusal test in test_router.py
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30351,7 +30351,9 @@ def test_pre_call_checks_refuses_a_stand_in_count_past_the_margin():
|
|||
tokens: Final = _stand_in_tokens(_RUSSIAN_PROMPT)
|
||||
largest_window_past_margin: Final = (tokens - 1) // STAND_IN_OVERCOUNT_MARGIN
|
||||
|
||||
with pytest.raises(litellm.ContextWindowExceededError):
|
||||
with pytest.raises(
|
||||
litellm.ContextWindowExceededError, match=f"Max Input Tokens={largest_window_past_margin}, Got={tokens}"
|
||||
):
|
||||
_kept_ids(_single_deployment("openai/my-fake-model", largest_window_past_margin), _RUSSIAN_PROMPT)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue