import asyncio


async def assert_complete_in_time(coroutine, time=0.01):
    """Assert that a coroutine is completed in time.

    Raises:
        AssertionError: if the coroutine is not completed

    """
    try:
        return await asyncio.wait_for(coroutine, timeout=time)
    except asyncio.TimeoutError:
        raise AssertionError from None