def test_lazy_function_coroutine(manager_nospawn):
    """Test that lazy.function accepts coroutines."""

    @Retry(ignore_exceptions=(AssertionError,))
    def assert_func_text(manager, value):
        _, text = manager.c.eval("self.test_func_output")
        assert text == value

    @lazy.function
    async def test_async_func(qtile, value):
        await asyncio.sleep(0.1)
        qtile.test_func_output = value

    config = ServerConfig
    config.keys = [libqtile.config.Key(["control"], "k", test_async_func("qtile"))]

    manager_nospawn.start(config)

    manager_nospawn.c.simulate_keypress(["control"], "k")
    assert_func_text(manager_nospawn, "qtile")
Test that lazy.function accepts coroutines.
test/test_command.py