Skip to content

Commit bf5c763

Browse files
committed
fixup! typing: tests: tmpfile
1 parent d678d38 commit bf5c763

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/_pytest/capture.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from io import UnsupportedOperation
1111
from tempfile import TemporaryFile
1212
from typing import BinaryIO
13-
from typing import List
13+
from typing import Iterable
1414

1515
import pytest
1616
from _pytest.compat import CaptureIO
@@ -419,15 +419,15 @@ def __init__(self, buffer: BinaryIO, encoding: str) -> None:
419419
self.buffer = buffer
420420
self.encoding = encoding
421421

422-
def write(self, obj: str) -> int:
423-
if not isinstance(obj, str):
422+
def write(self, s: str) -> int:
423+
if not isinstance(s, str):
424424
raise TypeError(
425-
"write() argument must be str, not {}".format(type(obj).__name__)
425+
"write() argument must be str, not {}".format(type(s).__name__)
426426
)
427-
return self.buffer.write(obj.encode(self.encoding, "replace"))
427+
return self.buffer.write(s.encode(self.encoding, "replace"))
428428

429-
def writelines(self, linelist: List[str]) -> None:
430-
self.buffer.writelines([x.encode(self.encoding, "replace") for x in linelist])
429+
def writelines(self, lines: Iterable[str]) -> None:
430+
self.buffer.writelines(x.encode(self.encoding, "replace") for x in lines)
431431

432432
@property
433433
def name(self) -> str:

0 commit comments

Comments
 (0)