tests/common.py
def mock_coro_func(return_value=None, exception=None):
    """Return a method to create a coro function that returns a value."""

    async def coro(*args, **kwargs):
        """Fake coroutine."""
        if exception:
            raise exception
        return return_value

    return coro
Return a method to create a coro function that returns a value.
Return a method to create a coro function that returns a value.
Return a method to create a coro function that returns a value .
def mock_coro_func(return_value=None, exception=None):
    async def coro(*args, **kwargs):
        if exception:
            raise exception
        return return_value
    return coro
def mock_coro_func ( return_value = None , exception = None ) : async def coro ( * args , ** kwargs ) : """Fake coroutine.""" if exception : raise exception return return_value return coro
Return a method to create a coro function that returns a value.
Return a method to create a coro function that returns a value .
"""Return a method to create a coro function that returns a value.""" """Fake coroutine."""
return_value
exception