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

Function test_execute_tools_parallel_with_error

tests/tools/test_execution.py:154–179  ·  view source on GitHub ↗

Test handling tool execution errors.

()

Source from the content-addressed store, hash-verified

152
153@pytest.mark.asyncio
154async def test_execute_tools_parallel_with_error():
155 """Test handling tool execution errors."""
156 manager = MockToolManager(
157 results={
158 "failing_tool": ToolCallResult(
159 tool_name="failing_tool",
160 success=False,
161 error="tool failed",
162 )
163 }
164 )
165
166 calls = [
167 CTPToolCall(id="call_1", tool="failing_tool", arguments={}),
168 CTPToolCall(id="call_2", tool="success_tool", arguments={}),
169 ]
170
171 results = await execute_tools_parallel(manager, calls)
172
173 assert len(results) == 2
174 failing = next(r for r in results if r.tool == "failing_tool")
175 success = next(r for r in results if r.tool == "success_tool")
176
177 assert not failing.is_success
178 assert failing.error == "tool failed"
179 assert success.is_success
180
181
182@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

ToolCallResultClass · 0.90
execute_tools_parallelFunction · 0.90
MockToolManagerClass · 0.70

Tested by

no test coverage detected