mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Mark mock as completed (#8919)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1 +1,4 @@
|
||||
version = "4.0.*"
|
||||
|
||||
[tool.stubtest]
|
||||
ignore_missing_stub = false
|
||||
|
||||
11
stubs/mock/mock/backports.pyi
Normal file
11
stubs/mock/mock/backports.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from asyncio import iscoroutinefunction as iscoroutinefunction
|
||||
from unittest import IsolatedAsyncioTestCase as IsolatedAsyncioTestCase
|
||||
else:
|
||||
import unittest
|
||||
|
||||
class IsolatedAsyncioTestCase(unittest.TestCase): ...
|
||||
# It is a typeguard, but its signature is to complex to duplicate.
|
||||
def iscoroutinefunction(obj: object) -> bool: ...
|
||||
@@ -1,10 +1,12 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from collections.abc import Awaitable, Callable, Mapping, Sequence
|
||||
from contextlib import AbstractContextManager
|
||||
from types import TracebackType
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
|
||||
_T = TypeVar("_T")
|
||||
_TT = TypeVar("_TT", bound=type[Any])
|
||||
_R = TypeVar("_R")
|
||||
@@ -159,6 +161,10 @@ class _patch(Generic[_T]):
|
||||
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
|
||||
def decorate_class(self, klass: _TT) -> _TT: ...
|
||||
def decorate_callable(self, func: _F) -> _F: ...
|
||||
def decorate_async_callable(self, func: _AF) -> _AF: ...
|
||||
def decoration_helper(
|
||||
self, patched: Any, args: tuple[Any, ...], keywargs: dict[str, Any]
|
||||
) -> AbstractContextManager[tuple[tuple[Any, ...], dict[str, Any]]]: ...
|
||||
def get_original(self) -> tuple[Any, bool]: ...
|
||||
target: Any
|
||||
temp_original: Any
|
||||
|
||||
Reference in New Issue
Block a user