chore(lint): satisfy stable/1.86.x's stricter formatters on backported code

stable/1.86.x enforces PLR0915 in the main ruff config; internal staging
moved it to a separate strict gate, so two functions that ship cleanly on
staging trip it here: _build_usage_only_response_from_chunks (#31035) and
the post-call cost callback (#30788). Exempt both files via the existing
per-file-ignores convention rather than editing the picked source. Also
black-normalize blank lines around the reconstructed TestInterruptedStream
class in the #30787 test file.
This commit is contained in:
Yuneng Jiang 2026-06-23 21:28:46 -07:00
parent 1d06533e09
commit 9257fff1cf
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View file

@ -19,3 +19,5 @@ exclude = ["litellm/types/*", "litellm/__init__.py", "litellm/proxy/example_conf
"litellm/responses/streaming_iterator.py" = ["PLR0915"]
"litellm/files/main.py" = ["PLR0915"]
"litellm/llms/litellm_proxy/skills/sandbox_executor.py" = ["PLR0915"]
"litellm/proxy/hooks/proxy_track_cost_callback.py" = ["PLR0915"]
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py" = ["PLR0915"]

View file

@ -752,6 +752,8 @@ class TestBuildCompleteStreamingResponseRobustness:
result = self._build(chunks)
assert result is not None
assert result.choices[0].message.content == "The stream ends with [DONE]"
class TestInterruptedStreamOutputTokenRecovery:
"""
When an Anthropic pass-through stream is interrupted (client disconnect)
@ -893,7 +895,6 @@ class TestInterruptedStreamOutputTokenRecovery:
assert usage.completion_tokens == final
class TestStreamFalseDeduplication:
"""
Regression tests for the duplicate-callback bug where a streaming pass-through