MCPcopy
hub / github.com/nonebot/nonebot2 / test_is_coroutine_callable

Function test_is_coroutine_callable

tests/test_utils.py:72–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70
71
72def test_is_coroutine_callable():
73 async def test1(): ...
74
75 def test2(): ...
76
77 class TestClass1:
78 async def __call__(self): ...
79
80 class TestClass2:
81 def __call__(self): ...
82
83 assert is_coroutine_callable(test1)
84 assert not is_coroutine_callable(test2)
85 assert not is_coroutine_callable(TestClass1)
86 assert is_coroutine_callable(TestClass1())
87 assert not is_coroutine_callable(TestClass2)
88
89
90def test_is_gen_callable():

Callers

nothing calls this directly

Calls 2

is_coroutine_callableFunction · 0.90
TestClass1Class · 0.85

Tested by

no test coverage detected