Skip to content

Commit f48221c

Browse files
committed
fix: apply ruff formatting
Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
1 parent 9c7f9ef commit f48221c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

python/packages/kagent-adk/src/kagent/adk/_mcp_toolset.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@
3737
# Keywords in McpError messages that indicate transport-level failures
3838
# (as opposed to protocol-level errors like invalid arguments).
3939
_TRANSPORT_MCP_ERROR_KEYWORDS = (
40-
"timeout", "timed out", "connection", "eof", "reset",
41-
"closed", "transport", "stream", "unreachable",
40+
"timeout",
41+
"timed out",
42+
"connection",
43+
"eof",
44+
"reset",
45+
"closed",
46+
"transport",
47+
"stream",
48+
"unreachable",
4249
)
4350

4451

python/packages/kagent-adk/tests/unittests/test_mcp_connection_error_handling.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ async def test_httpx_connect_timeout_returns_error_dict():
9696
@pytest.mark.asyncio
9797
async def test_transport_mcp_error_returns_error_dict():
9898
"""McpError with a transport-level message (e.g., session read timeout) should be caught."""
99-
tool = _make_connection_safe_tool(
100-
McpError(ErrorData(code=-1, message="session read timeout"))
101-
)
99+
tool = _make_connection_safe_tool(McpError(ErrorData(code=-1, message="session read timeout")))
102100

103101
result = await tool.run_async(args={}, tool_context=MagicMock())
104102

@@ -110,9 +108,7 @@ async def test_transport_mcp_error_returns_error_dict():
110108
@pytest.mark.asyncio
111109
async def test_protocol_mcp_error_still_raises():
112110
"""McpError with a protocol-level message (e.g., invalid arguments) should propagate."""
113-
tool = _make_connection_safe_tool(
114-
McpError(ErrorData(code=-32602, message="Invalid params: unknown tool"))
115-
)
111+
tool = _make_connection_safe_tool(McpError(ErrorData(code=-32602, message="Invalid params: unknown tool")))
116112

117113
with pytest.raises(McpError, match="Invalid params"):
118114
await tool.run_async(args={}, tool_context=MagicMock())

0 commit comments

Comments
 (0)