Skip to content

Commit aaf69c3

Browse files
Merge branch 'webb/test-fastmcp-stdio' into webb/test-mcp-streamable-http
2 parents 30e9ec3 + 8aa6363 commit aaf69c3

1 file changed

Lines changed: 2 additions & 39 deletions

File tree

tests/integrations/mcp/test_mcp.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def failing_tool(tool_name, arguments):
422422
"send_default_pii, include_prompts",
423423
[(True, True), (True, False), (False, True), (False, False)],
424424
)
425-
async def test_prompt_handler_sync(
425+
async def test_prompt_handler_stdio(
426426
sentry_init, capture_events, send_default_pii, include_prompts, stdio
427427
):
428428
"""Test that synchronous prompt handlers create proper spans"""
@@ -613,7 +613,7 @@ async def failing_prompt(name, arguments):
613613

614614

615615
@pytest.mark.asyncio
616-
async def test_resource_handler_sync(sentry_init, capture_events, stdio):
616+
async def test_resource_handler_stdio(sentry_init, capture_events, stdio):
617617
"""Test that synchronous resource handlers create proper spans"""
618618
sentry_init(
619619
integrations=[MCPIntegration()],
@@ -1098,43 +1098,6 @@ def test_tool_complex(tool_name, arguments):
10981098
assert span["data"]["mcp.request.argument.number"] == "42"
10991099

11001100

1101-
@pytest.mark.asyncio
1102-
async def test_async_handlers_mixed(sentry_init, capture_events):
1103-
"""Test mixing sync and async handlers in the same transaction"""
1104-
sentry_init(
1105-
integrations=[MCPIntegration()],
1106-
traces_sample_rate=1.0,
1107-
)
1108-
events = capture_events()
1109-
1110-
server = Server("test-server")
1111-
1112-
# Set up mock request context
1113-
mock_ctx = MockRequestContext(request_id="req-mixed", transport="stdio")
1114-
request_ctx.set(mock_ctx)
1115-
1116-
@server.call_tool()
1117-
def sync_tool(tool_name, arguments):
1118-
return {"type": "sync"}
1119-
1120-
@server.call_tool()
1121-
async def async_tool(tool_name, arguments):
1122-
return {"type": "async"}
1123-
1124-
with start_transaction(name="mcp tx"):
1125-
sync_result = sync_tool("sync", {})
1126-
async_result = await async_tool("async", {})
1127-
1128-
assert sync_result["type"] == "sync"
1129-
assert async_result["type"] == "async"
1130-
1131-
(tx,) = events
1132-
assert len(tx["spans"]) == 2
1133-
1134-
# Both should be instrumented correctly
1135-
assert all(span["op"] == OP.MCP_SERVER for span in tx["spans"])
1136-
1137-
11381101
def test_sse_transport_detection(sentry_init, capture_events):
11391102
"""Test that SSE transport is correctly detected via query parameter"""
11401103
sentry_init(

0 commit comments

Comments
 (0)