Skip to content

Commit 0bbd04a

Browse files
committed
test: make stdio newline spy pyright-friendly
1 parent 5ac79b4 commit 0bbd04a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/server/test_stdio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from collections.abc import AsyncIterator
55
from contextlib import asynccontextmanager
66
from io import TextIOWrapper
7+
from typing import Any
78

89
import anyio
910
import pytest
@@ -105,10 +106,10 @@ async def test_stdio_server_disables_newline_translation(monkeypatch: pytest.Mon
105106
monkeypatch.setattr(sys, "stdin", TextIOWrapper(raw_stdin, encoding="utf-8"))
106107
monkeypatch.setattr(sys, "stdout", TextIOWrapper(raw_stdout, encoding="utf-8"))
107108

108-
calls: list[dict[str, object | None]] = []
109+
calls: list[dict[str, str | None]] = []
109110
real_text_io_wrapper = TextIOWrapper
110111

111-
def spy(buffer: io.BufferedIOBase, *args: object, **kwargs: object) -> TextIOWrapper:
112+
def spy(buffer: Any, *args: Any, **kwargs: Any) -> TextIOWrapper:
112113
calls.append({"errors": kwargs.get("errors"), "newline": kwargs.get("newline")})
113114
return real_text_io_wrapper(buffer, *args, **kwargs)
114115

0 commit comments

Comments
 (0)