Skip to content

Commit a7377db

Browse files
committed
fix test
1 parent ac1aaea commit a7377db

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/mcp/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def __aenter__(self) -> Client:
128128

129129
async def __aexit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: Any) -> None:
130130
"""Exit the async context manager."""
131-
if self._exit_stack:
131+
if self._exit_stack: # pragma: no branch
132132
await self._exit_stack.__aexit__(exc_type, exc_val, exc_tb)
133133
self._session = None
134134

tests/client/test_client.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ def greet(name: str) -> str:
7777
"""Greet someone by name."""
7878
return f"Hello, {name}!"
7979

80-
@server.tool()
81-
def add(a: int, b: int) -> int:
82-
"""Add two numbers."""
83-
return a + b
84-
8580
@server.resource("test://resource")
8681
def test_resource() -> str:
8782
"""A test resource."""
@@ -146,27 +141,7 @@ async def test_client_list_tools(app: FastMCP):
146141
"title": "greetOutput",
147142
"type": "object",
148143
},
149-
),
150-
Tool(
151-
name="add",
152-
description="Add two numbers.",
153-
input_schema={
154-
"properties": {
155-
"a": {"title": "A", "type": "integer"},
156-
"b": {"title": "B", "type": "integer"},
157-
},
158-
"required": ["a", "b"],
159-
"title": "addArguments",
160-
"type": "object",
161-
},
162-
output_schema={
163-
"properties": {"result": {"title": "Result", "type": "integer"}},
164-
"required": ["result"],
165-
"title": "addOutput",
166-
"type": "object",
167-
},
168-
),
169-
]
144+
)]
170145
)
171146
)
172147

0 commit comments

Comments
 (0)