mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Drop Python 3.8 branches (#13776)
This commit is contained in:
@@ -21,5 +21,5 @@ class IsolatedAsyncioTestCase(TestCase):
|
||||
def addAsyncCleanup(self, func: Callable[_P, Awaitable[object]], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
async def enterAsyncContext(self, cm: AbstractAsyncContextManager[_T]) -> _T: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
@@ -5,27 +5,12 @@ from _typeshed import SupportsDunderGE, SupportsDunderGT, SupportsDunderLE, Supp
|
||||
from collections.abc import Callable, Container, Iterable, Mapping, Sequence, Set as AbstractSet
|
||||
from contextlib import AbstractContextManager
|
||||
from re import Pattern
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
Any,
|
||||
AnyStr,
|
||||
ClassVar,
|
||||
Final,
|
||||
Generic,
|
||||
NamedTuple,
|
||||
NoReturn,
|
||||
Protocol,
|
||||
SupportsAbs,
|
||||
SupportsRound,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import Any, AnyStr, Final, Generic, NoReturn, Protocol, SupportsAbs, SupportsRound, TypeVar, overload
|
||||
from typing_extensions import Never, ParamSpec, Self, TypeAlias
|
||||
from unittest._log import _AssertLogsContext, _LoggingWatcher
|
||||
from warnings import WarningMessage
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
from types import UnionType
|
||||
|
||||
@@ -58,29 +43,6 @@ class _AssertRaisesBaseContext(_BaseTestCaseContext):
|
||||
# but it's not possible to construct an overload which expresses that
|
||||
def handle(self, name: str, args: list[Any], kwargs: dict[str, Any]) -> Any: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from unittest._log import _AssertLogsContext, _LoggingWatcher
|
||||
else:
|
||||
# Unused dummy for _AssertLogsContext. Starting with Python 3.10,
|
||||
# this is generic over the logging watcher, but in lower versions
|
||||
# the watcher is hard-coded.
|
||||
_L = TypeVar("_L")
|
||||
|
||||
class _LoggingWatcher(NamedTuple):
|
||||
records: list[logging.LogRecord]
|
||||
output: list[str]
|
||||
|
||||
class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]):
|
||||
LOGGING_FORMAT: ClassVar[str]
|
||||
logger_name: str
|
||||
level: int
|
||||
msg: None
|
||||
def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ...
|
||||
def __enter__(self) -> _LoggingWatcher: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
def addModuleCleanup(function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
def doModuleCleanups() -> None: ...
|
||||
|
||||
@@ -345,8 +307,7 @@ class _AssertRaisesContext(_AssertRaisesBaseContext, Generic[_E]):
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None
|
||||
) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
|
||||
class _AssertWarnsContext(_AssertRaisesBaseContext):
|
||||
warning: WarningMessage
|
||||
|
||||
@@ -51,9 +51,6 @@ else:
|
||||
"seal",
|
||||
)
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
__version__: Final[str]
|
||||
|
||||
FILTER_DIR: Any
|
||||
|
||||
class _SentinelObject:
|
||||
|
||||
Reference in New Issue
Block a user