mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -19,7 +19,6 @@ from typing import (
|
||||
NoReturn,
|
||||
Pattern,
|
||||
Sequence,
|
||||
Type,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
@@ -55,7 +54,7 @@ else:
|
||||
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_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -71,7 +70,7 @@ class SkipTest(Exception):
|
||||
def __init__(self, reason: str) -> None: ...
|
||||
|
||||
class TestCase:
|
||||
failureException: Type[BaseException]
|
||||
failureException: type[BaseException]
|
||||
longMessage: bool
|
||||
maxDiff: int | None
|
||||
# undocumented
|
||||
@@ -110,17 +109,17 @@ class TestCase:
|
||||
@overload
|
||||
def assertRaises( # type: ignore[misc]
|
||||
self,
|
||||
expected_exception: Type[BaseException] | tuple[Type[BaseException], ...],
|
||||
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertRaises(self, expected_exception: Type[_E] | tuple[Type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
def assertRaises(self, expected_exception: type[_E] | tuple[type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertRaisesRegex( # type: ignore[misc]
|
||||
self,
|
||||
expected_exception: Type[BaseException] | tuple[Type[BaseException], ...],
|
||||
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
@@ -129,20 +128,20 @@ class TestCase:
|
||||
@overload
|
||||
def assertRaisesRegex(
|
||||
self,
|
||||
expected_exception: Type[_E] | tuple[Type[_E], ...],
|
||||
expected_exception: type[_E] | tuple[type[_E], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
msg: Any = ...,
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertWarns( # type: ignore[misc]
|
||||
self, expected_warning: Type[Warning] | tuple[Type[Warning], ...], callable: Callable[..., Any], *args: Any, **kwargs: Any
|
||||
self, expected_warning: type[Warning] | tuple[type[Warning], ...], callable: Callable[..., Any], *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertWarns(self, expected_warning: Type[Warning] | tuple[Type[Warning], ...], msg: Any = ...) -> _AssertWarnsContext: ...
|
||||
def assertWarns(self, expected_warning: type[Warning] | tuple[type[Warning], ...], msg: Any = ...) -> _AssertWarnsContext: ...
|
||||
@overload
|
||||
def assertWarnsRegex( # type: ignore[misc]
|
||||
self,
|
||||
expected_warning: Type[Warning] | tuple[Type[Warning], ...],
|
||||
expected_warning: type[Warning] | tuple[type[Warning], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
@@ -151,7 +150,7 @@ class TestCase:
|
||||
@overload
|
||||
def assertWarnsRegex(
|
||||
self,
|
||||
expected_warning: Type[Warning] | tuple[Type[Warning], ...],
|
||||
expected_warning: type[Warning] | tuple[type[Warning], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
msg: Any = ...,
|
||||
) -> _AssertWarnsContext: ...
|
||||
@@ -193,10 +192,10 @@ class TestCase:
|
||||
def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = ...) -> None: ...
|
||||
def addTypeEqualityFunc(self, typeobj: Type[Any], function: Callable[..., None]) -> None: ...
|
||||
def addTypeEqualityFunc(self, typeobj: type[Any], function: Callable[..., None]) -> None: ...
|
||||
def assertMultiLineEqual(self, first: str, second: str, msg: Any = ...) -> None: ...
|
||||
def assertSequenceEqual(
|
||||
self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = ..., seq_type: Type[Sequence[Any]] | None = ...
|
||||
self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = ..., seq_type: type[Sequence[Any]] | None = ...
|
||||
) -> None: ...
|
||||
def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ...
|
||||
def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ...
|
||||
@@ -230,13 +229,13 @@ class TestCase:
|
||||
@overload
|
||||
def failUnlessRaises( # type: ignore[misc]
|
||||
self,
|
||||
exception: Type[BaseException] | tuple[Type[BaseException], ...],
|
||||
exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
callable: Callable[..., Any] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises(self, exception: Type[_E] | tuple[Type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
def failUnlessRaises(self, exception: type[_E] | tuple[type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ...
|
||||
def assertAlmostEquals(
|
||||
self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...
|
||||
@@ -250,7 +249,7 @@ class TestCase:
|
||||
@overload
|
||||
def assertRaisesRegexp( # type: ignore[misc]
|
||||
self,
|
||||
exception: Type[BaseException] | tuple[Type[BaseException], ...],
|
||||
exception: type[BaseException] | tuple[type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
@@ -259,7 +258,7 @@ class TestCase:
|
||||
@overload
|
||||
def assertRaisesRegexp(
|
||||
self,
|
||||
exception: Type[_E] | tuple[Type[_E], ...],
|
||||
exception: type[_E] | tuple[type[_E], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
msg: Any = ...,
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
@@ -281,7 +280,7 @@ class _AssertRaisesContext(Generic[_E]):
|
||||
exception: _E
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
@@ -293,5 +292,5 @@ class _AssertWarnsContext:
|
||||
warnings: list[WarningMessage]
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user