Skip to content

Commit b2dde3d

Browse files
committed
Fix type narrowing for TextContent in test
1 parent f310e39 commit b2dde3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/issues/test_1356_sse_parsing_line_separator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ async def test_json_parsing_with_problematic_unicode(problematic_server: str) ->
145145
assert len(response.content) == 1
146146
text_content = response.content[0]
147147
assert hasattr(text_content, "text"), f"Response doesn't have text: {text_content}"
148+
149+
# Type narrowing for pyright
150+
from mcp.types import TextContent
151+
assert isinstance(text_content, TextContent)
148152

149153
expected = "This text contains a line separator\u2028character that may break JSON parsing"
150154
assert text_content.text == expected, f"Expected: {expected!r}, Got: {text_content.text!r}"

0 commit comments

Comments
 (0)