Skip to content

Commit d6375cd

Browse files
committed
test: make stdio newline spy pyright-friendly
1 parent 432746b commit d6375cd

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
@@ -1,6 +1,7 @@
11
import io
22
import sys
33
from io import TextIOWrapper
4+
from typing import Any
45

56
import anyio
67
import pytest
@@ -103,10 +104,10 @@ async def test_stdio_server_disables_newline_translation(monkeypatch: pytest.Mon
103104
monkeypatch.setattr(sys, "stdin", TextIOWrapper(raw_stdin, encoding="utf-8"))
104105
monkeypatch.setattr(sys, "stdout", TextIOWrapper(raw_stdout, encoding="utf-8"))
105106

106-
calls: list[dict[str, object | None]] = []
107+
calls: list[dict[str, str | None]] = []
107108
real_text_io_wrapper = TextIOWrapper
108109

109-
def spy(buffer: io.BufferedIOBase, *args: object, **kwargs: object) -> TextIOWrapper:
110+
def spy(buffer: Any, *args: Any, **kwargs: Any) -> TextIOWrapper:
110111
calls.append({"errors": kwargs.get("errors"), "newline": kwargs.get("newline")})
111112
return real_text_io_wrapper(buffer, *args, **kwargs)
112113

0 commit comments

Comments
 (0)