mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add @type_check_only to stub-only private classes in stdlib (#14512)
This commit is contained in:
@@ -4,15 +4,17 @@ import unittest.result
|
||||
import unittest.suite
|
||||
from _typeshed import SupportsFlush, SupportsWrite
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, Generic, Protocol, TypeVar
|
||||
from typing import Any, Generic, Protocol, TypeVar, type_check_only
|
||||
from typing_extensions import Never, TypeAlias
|
||||
from warnings import _ActionKind
|
||||
|
||||
_ResultClassType: TypeAlias = Callable[[_TextTestStream, bool, int], TextTestResult[Any]]
|
||||
|
||||
@type_check_only
|
||||
class _SupportsWriteAndFlush(SupportsWrite[str], SupportsFlush, Protocol): ...
|
||||
|
||||
# All methods used by unittest.runner.TextTestResult's stream
|
||||
@type_check_only
|
||||
class _TextTestStream(_SupportsWriteAndFlush, Protocol):
|
||||
def writeln(self, arg: str | None = None, /) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user