MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _is_async_obj

Function _is_async_obj

tools/python-3.11.9-amd64/Lib/unittest/mock.py:53–58  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

51_safe_super = super
52
53def _is_async_obj(obj):
54 if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
55 return False
56 if hasattr(obj, '__func__'):
57 obj = getattr(obj, '__func__')
58 return iscoroutinefunction(obj) or inspect.isawaitable(obj)
59
60
61def _is_async_func(func):

Callers 2

__new__Method · 0.85
__enter__Method · 0.85

Calls 2

iscoroutinefunctionFunction · 0.90
_is_instance_mockFunction · 0.85

Tested by

no test coverage detected