Skip to content

Commit a2ee32b

Browse files
unittest: make protocol parameter positional-only (#12834)
1 parent b78b3f1 commit a2ee32b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/unittest/runner.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ class _SupportsWriteAndFlush(SupportsWrite[str], SupportsFlush, Protocol): ...
1313

1414
# All methods used by unittest.runner.TextTestResult's stream
1515
class _TextTestStream(_SupportsWriteAndFlush, Protocol):
16-
def writeln(self, arg: str | None = None) -> str: ...
16+
def writeln(self, arg: str | None = None, /) -> str: ...
1717

1818
# _WritelnDecorator should have all the same attrs as its stream param.
1919
# But that's not feasible to do Generically
2020
# We can expand the attributes if requested
2121
class _WritelnDecorator(_TextTestStream):
2222
def __init__(self, stream: _TextTestStream) -> None: ...
23+
def writeln(self, arg: str | None = None) -> str: ...
2324
def __getattr__(self, attr: str) -> Any: ... # Any attribute from the stream type passed to __init__
2425
# These attributes are prevented by __getattr__
2526
stream: Never

0 commit comments

Comments
 (0)