Skip to content

Commit 7ef1e95

Browse files
author
Nova
committed
fix: format test file and remove unused imports
- Collapse multi-line io.BytesIO() to single line (ruff format) - Add blank line after module docstring (ruff format) - Remove unused imports: time, anyio (ruff check --fix)
1 parent 88f9276 commit 7ef1e95

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

tests/server/test_stdio_2678.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
read_stream_writer in stdin_reader's finally block so the server sees EOF and
66
can flush pending writes before the task group exits.
77
"""
8+
89
import io
910
import sys
1011
import threading
11-
import time
1212
from io import TextIOWrapper
1313

14-
import anyio
1514
import pytest
1615

1716
from mcp.server.mcpserver import MCPServer
@@ -46,9 +45,7 @@ def test_stdio_response_not_dropped_on_eof(monkeypatch: pytest.MonkeyPatch) -> N
4645
the server could flush its response through stdout_writer.
4746
"""
4847
ping = JSONRPCRequest(jsonrpc="2.0", id=1, method="ping")
49-
stdin_bytes = io.BytesIO(
50-
ping.model_dump_json(by_alias=True, exclude_none=True).encode() + b"\n"
51-
)
48+
stdin_bytes = io.BytesIO(ping.model_dump_json(by_alias=True, exclude_none=True).encode() + b"\n")
5249
captured = _KeepOpenBytesIO()
5350
monkeypatch.setattr(sys, "stdin", TextIOWrapper(stdin_bytes, encoding="utf-8"))
5451
monkeypatch.setattr(sys, "stdout", TextIOWrapper(captured, encoding="utf-8"))

0 commit comments

Comments
 (0)