from asyncio import coroutine
from unittest.mock import Mock

__all__ = ["coro_mock"]


def coro_mock():
    coro = Mock(name="CoroutineResult")
    corofunc = Mock(name="CoroutineFunction", side_effect=coroutine(coro))
    corofunc.coro = coro
    return corofunc
