def async_test(func):
    """Decorator for running async tests.

    Prints out tasks that are still running after the test completes.
    """

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        loop = asyncio.new_event_loop()
        temp = loop.run_until_complete(func(*args, **kwargs))

        for task in asyncio.all_tasks(loop):
            print("Task still running:")
            task.print_stack()

        loop.close()
        return temp

    return wrapper
Decorator for running async tests.

    Prints out tasks that are still running after the test completes.
    
tests/test.py