Mark mock as completed (#8919)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Nikita Sobolev
2022-10-19 20:40:37 +03:00
committed by GitHub
parent 96af812c07
commit 193172efba
3 changed files with 21 additions and 1 deletions

View File

@@ -1 +1,4 @@
version = "4.0.*"
[tool.stubtest]
ignore_missing_stub = false

View 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: ...

View File

@@ -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