Test handling tool execution errors.
()
| 152 | |
| 153 | @pytest.mark.asyncio |
| 154 | async 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 |
nothing calls this directly
no test coverage detected