MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_stream_execute_tools_with_error

Function test_stream_execute_tools_with_error

tests/tools/test_execution.py:321–342  ·  view source on GitHub ↗

Test streaming handles errors gracefully.

()

Source from the content-addressed store, hash-verified

319
320@pytest.mark.asyncio
321async def test_stream_execute_tools_with_error():
322 """Test streaming handles errors gracefully."""
323 manager = MockToolManager(
324 results={
325 "failing_tool": ToolCallResult(
326 tool_name="failing_tool",
327 success=False,
328 error="tool failed",
329 )
330 }
331 )
332
333 calls = [
334 CTPToolCall(id="call_1", tool="failing_tool", arguments={}),
335 CTPToolCall(id="call_2", tool="success_tool", arguments={}),
336 ]
337
338 results = []
339 async for result in stream_execute_tools(manager, calls):
340 results.append(result)
341
342 assert len(results) == 2
343
344
345@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

ToolCallResultClass · 0.90
stream_execute_toolsFunction · 0.90
MockToolManagerClass · 0.70

Tested by

no test coverage detected