MCPcopy
hub / github.com/encode/starlette / test_async_partial_object_call

Function test_async_partial_object_call

tests/test__utils.py:58–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def test_async_partial_object_call() -> None:
59 class Async:
60 async def __call__(
61 self,
62 a: Any,
63 b: Any,
64 ) -> None: ... # pragma: no cover
65
66 class Sync:
67 def __call__(
68 self,
69 a: Any,
70 b: Any,
71 ) -> None: ... # pragma: no cover
72
73 partial = functools.partial(Async(), 1)
74 assert is_async_callable(partial)
75
76 partial = functools.partial(Sync(), 1) # type: ignore
77 assert not is_async_callable(partial)
78
79
80def test_async_nested_partial() -> None:

Callers

nothing calls this directly

Calls 3

is_async_callableFunction · 0.90
AsyncClass · 0.85
SyncClass · 0.85

Tested by

no test coverage detected