Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions tests/integrations/fastmcp/test_fastmcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,36 +896,6 @@ def test_tool(value: int) -> int:
assert mcp_spans[0]["origin"] == "auto.ai.mcp"


@pytest.mark.parametrize("FastMCP", fastmcp_implementations, ids=fastmcp_ids)
def test_fastmcp_without_request_context(sentry_init, capture_events, FastMCP):
"""Test FastMCP handling when no request context is available"""
sentry_init(
integrations=[MCPIntegration()],
traces_sample_rate=1.0,
)
events = capture_events()

mcp = FastMCP("Test Server")

# Clear request context
if request_ctx is not None:
request_ctx.set(None)

@mcp.tool()
def test_tool_no_ctx(x: int) -> dict:
"""Test tool without context"""
return {"result": x + 1}

with start_transaction(name="fastmcp tx"):
result = call_tool_through_mcp(mcp, "test_tool_no_ctx", {"x": 99})

assert result == {"result": 100}

# Should still create transaction even if context is missing
(tx,) = events
assert tx["type"] == "transaction"


# =============================================================================
# Transport Detection Tests
# =============================================================================
Expand Down
Loading