Drop Python 3.8 branches (#13776)

This commit is contained in:
Sebastian Rittau
2025-04-03 10:35:36 +02:00
committed by GitHub
parent 1e43190554
commit 30b16c168d
117 changed files with 1023 additions and 2639 deletions
+2 -2
View File
@@ -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: ...
+4 -43
View File
@@ -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
-3
View File
@@ -51,9 +51,6 @@ else:
"seal",
)
if sys.version_info < (3, 9):
__version__: Final[str]
FILTER_DIR: Any
class _SentinelObject: