Files
litellm/tests
Julio Quinteros ProandClaude Opus 4.6 e8301829cd Fix flaky MCP streaming test by properly mocking inner aresponses call
The test_streaming_mcp_events_validation test was flaky because:
1. It didn't mock the nested aresponses() call inside the iterator's
   _create_initial_response_iterator(), causing real API calls that fail
   without credentials
2. The iterator silently swallowed exceptions and set phase="finished",
   discarding pre-generated MCP discovery events
3. The _execute_tool_calls mock had wrong signature (missing tool_server_map)

Production fix: MCPEnhancedStreamingIterator no longer sets phase="finished"
on LLM call failure — it falls through to emit MCP discovery events first.

Test fix: Added mock for litellm.responses.main.aresponses returning a fake
async streaming iterator, fixed mock signatures, removed try/except that
masked failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 11:09:24 -03:00
..
2026-02-28 09:46:35 -08:00
2026-02-21 15:48:26 -08:00
2026-02-28 09:46:35 -08:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.