Skip to content

Commit 43a30c1

Browse files
committed
fix tests
1 parent 91840fd commit 43a30c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/server/fastmcp/test_server.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,11 @@ async def test_context_logging(self):
521521
"""Test that context logging methods work."""
522522
mcp = FastMCP()
523523

524-
def logging_tool(msg: str, ctx: Context) -> str:
525-
ctx.debug("Debug message")
526-
ctx.info("Info message")
527-
ctx.warning("Warning message")
528-
ctx.error("Error message")
524+
async def logging_tool(msg: str, ctx: Context) -> str:
525+
await ctx.debug("Debug message")
526+
await ctx.info("Info message")
527+
await ctx.warning("Warning message")
528+
await ctx.error("Error message")
529529
return f"Logged messages for {msg}"
530530

531531
mcp.add_tool(logging_tool)
@@ -563,8 +563,8 @@ def test_resource() -> str:
563563

564564
@mcp.tool()
565565
async def tool_with_resource(ctx: Context) -> str:
566-
data = await ctx.read_resource("test://data")
567-
return f"Read resource: {data}"
566+
data, mime_type = await ctx.read_resource("test://data")
567+
return f"Read resource: {data} with mime type {mime_type}"
568568

569569
async with client_session(mcp._mcp_server) as client:
570570
result = await client.call_tool("tool_with_resource", {})

0 commit comments

Comments
 (0)