diff --git a/src/textual/drivers/headless_driver.py b/src/textual/drivers/headless_driver.py index 60e5f8bb0b..1e4a157357 100644 --- a/src/textual/drivers/headless_driver.py +++ b/src/textual/drivers/headless_driver.py @@ -3,7 +3,7 @@ import asyncio from textual import events -from textual.driver import Driver +from textual.driver import Driver, TerminalColours, TerminalGaveNoPalette from textual.geometry import Size @@ -41,6 +41,15 @@ def write(self, data: str) -> None: """ # Nothing to write as this is a headless driver. + async def query_colours(self, *, timeout: float) -> TerminalColours: + """There is no terminal to ask: the query goes nowhere, so no reply can come. + + The inherited query waited out its whole deadline for answers to writes that went + nowhere, so every headless app that asked (each of Toad's app tests, at startup) + sat idle for the full timeout before getting this same answer. + """ + raise TerminalGaveNoPalette("a headless driver has no terminal to ask for a palette") + def start_application_mode(self) -> None: """Start application mode.""" loop = asyncio.get_running_loop()