Skip to content

Commit 8aa6363

Browse files
merge
2 parents ac8e6e4 + 6579935 commit 8aa6363

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

tests/integrations/mcp/test_mcp.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def failing_tool(tool_name, arguments):
334334
"send_default_pii, include_prompts",
335335
[(True, True), (True, False), (False, True), (False, False)],
336336
)
337-
async def test_prompt_handler_sync(
337+
async def test_prompt_handler_stdio(
338338
sentry_init, capture_events, send_default_pii, include_prompts, stdio
339339
):
340340
"""Test that synchronous prompt handlers create proper spans"""
@@ -498,7 +498,7 @@ async def failing_prompt(name, arguments):
498498

499499

500500
@pytest.mark.asyncio
501-
async def test_resource_handler_sync(sentry_init, capture_events, stdio):
501+
async def test_resource_handler_stdio(sentry_init, capture_events, stdio):
502502
"""Test that synchronous resource handlers create proper spans"""
503503
sentry_init(
504504
integrations=[MCPIntegration()],
@@ -963,43 +963,6 @@ def test_tool_complex(tool_name, arguments):
963963
assert span["data"]["mcp.request.argument.number"] == "42"
964964

965965

966-
@pytest.mark.asyncio
967-
async def test_async_handlers_mixed(sentry_init, capture_events):
968-
"""Test mixing sync and async handlers in the same transaction"""
969-
sentry_init(
970-
integrations=[MCPIntegration()],
971-
traces_sample_rate=1.0,
972-
)
973-
events = capture_events()
974-
975-
server = Server("test-server")
976-
977-
# Set up mock request context
978-
mock_ctx = MockRequestContext(request_id="req-mixed", transport="stdio")
979-
request_ctx.set(mock_ctx)
980-
981-
@server.call_tool()
982-
def sync_tool(tool_name, arguments):
983-
return {"type": "sync"}
984-
985-
@server.call_tool()
986-
async def async_tool(tool_name, arguments):
987-
return {"type": "async"}
988-
989-
with start_transaction(name="mcp tx"):
990-
sync_result = sync_tool("sync", {})
991-
async_result = await async_tool("async", {})
992-
993-
assert sync_result["type"] == "sync"
994-
assert async_result["type"] == "async"
995-
996-
(tx,) = events
997-
assert len(tx["spans"]) == 2
998-
999-
# Both should be instrumented correctly
1000-
assert all(span["op"] == OP.MCP_SERVER for span in tx["spans"])
1001-
1002-
1003966
def test_sse_transport_detection(sentry_init, capture_events):
1004967
"""Test that SSE transport is correctly detected via query parameter"""
1005968
sentry_init(

0 commit comments

Comments
 (0)