Skip to content

Commit a43e936

Browse files
authored
fix: fix mcp tests (#1664)
1 parent 66fb308 commit a43e936

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests_integ/mcp/test_mcp_client_tasks.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,18 @@ def test_tasks_disabled_by_default(self, task_mcp_client_disabled: MCPClient) ->
129129
assert task_mcp_client_disabled._is_tasks_enabled() is False
130130
assert task_mcp_client_disabled._should_use_task("task_required_echo") is False
131131

132-
# Tool calls still work via direct call_tool
132+
# Direct call_tool still works for tools that support it
133133
result = task_mcp_client_disabled.call_tool_sync(
134-
tool_use_id="t", name="task_required_echo", arguments={"message": "Direct!"}
134+
tool_use_id="t", name="task_optional_echo", arguments={"message": "Direct!"}
135135
)
136136
assert result["status"] == "success"
137137

138+
# Task-required tools fail gracefully via direct call
139+
result2 = task_mcp_client_disabled.call_tool_sync(
140+
tool_use_id="t2", name="task_required_echo", arguments={"message": "Direct!"}
141+
)
142+
assert result2["status"] == "error"
143+
138144
@pytest.mark.asyncio
139145
async def test_async_tool_call(self, task_mcp_client: MCPClient) -> None:
140146
"""Test async tool calls."""

0 commit comments

Comments
 (0)