Skip to content

Commit e00d336

Browse files
committed
Use isinstance assert instead of type: ignore in OTel test
1 parent b47c9c5 commit e00d336

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/shared/test_otel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44
from logfire.testing import CaptureLogfire
55

6+
from mcp import types
67
from mcp.client.client import Client
78
from mcp.server.mcpserver import MCPServer
89

@@ -24,7 +25,8 @@ def greet(name: str) -> str:
2425
async with Client(server) as client:
2526
result = await client.call_tool("greet", {"name": "World"})
2627

27-
assert result.content[0].text == "Hello, World!" # type: ignore[union-attr]
28+
assert isinstance(result.content[0], types.TextContent)
29+
assert result.content[0].text == "Hello, World!"
2830

2931
spans = capfire.exporter.exported_spans_as_dict()
3032
span_names = {s["name"] for s in spans}

0 commit comments

Comments
 (0)