mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Use PEP 570 syntax in stdlib (#11250)
This commit is contained in:
@@ -14,7 +14,7 @@ _P = ParamSpec("_P")
|
||||
class IsolatedAsyncioTestCase(TestCase):
|
||||
async def asyncSetUp(self) -> None: ...
|
||||
async def asyncTearDown(self) -> None: ...
|
||||
def addAsyncCleanup(self, __func: Callable[_P, Awaitable[object]], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
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):
|
||||
|
||||
@@ -68,7 +68,7 @@ else:
|
||||
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 addModuleCleanup(function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
def doModuleCleanups() -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
@@ -273,14 +273,14 @@ class TestCase:
|
||||
def defaultTestResult(self) -> unittest.result.TestResult: ...
|
||||
def id(self) -> str: ...
|
||||
def shortDescription(self) -> str | None: ...
|
||||
def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
def addCleanup(self, function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
|
||||
def doCleanups(self) -> None: ...
|
||||
@classmethod
|
||||
def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
def addClassCleanup(cls, function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
@classmethod
|
||||
def doClassCleanups(cls) -> None: ...
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ MAIN_EXAMPLES: str
|
||||
MODULE_EXAMPLES: str
|
||||
|
||||
class _TestRunner(Protocol):
|
||||
def run(self, __test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ...
|
||||
def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase, /) -> unittest.result.TestResult: ...
|
||||
|
||||
# not really documented
|
||||
class TestProgram:
|
||||
|
||||
@@ -65,7 +65,7 @@ class _Call(tuple[Any, ...]):
|
||||
from_kall: bool = True,
|
||||
) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, __value: object) -> bool: ...
|
||||
def __ne__(self, value: object, /) -> bool: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _Call: ...
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
def __getattribute__(self, attr: str) -> Any: ...
|
||||
@@ -103,7 +103,7 @@ class NonCallableMock(Base, Any):
|
||||
**kwargs: Any,
|
||||
) -> Self: ...
|
||||
else:
|
||||
def __new__(__cls, *args: Any, **kw: Any) -> Self: ...
|
||||
def __new__(cls, /, *args: Any, **kw: Any) -> Self: ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -234,7 +234,7 @@ class _patch(Generic[_T]):
|
||||
is_local: bool
|
||||
def __enter__(self) -> _T: ...
|
||||
def __exit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> None: ...
|
||||
def start(self) -> _T: ...
|
||||
def stop(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user