We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Pilot.click can't use `Screen` as selector.
If you try something like `pilot.click(Screen)`, you get a `NoMatches` exception from the query.
Pilot.click can't use `Screen` as selector.
If you try something like `pilot.click(Screen)`, you get a `NoMatches` exception from the query.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/textual/pilot.py`
Content:
```
1 """
2 
3 The pilot object is used by [App.run_test][textual.app.App.run_test] to programmatically operate an app.
4 
5 See the guide on how to [test Textual apps](/guide/testing).
6 
7 """
8 
9 from __future__ import annotations
10 
11 import asyncio
12 from typing import Any, Generic
13 
14 import rich.repr
15 
16 from ._wait import wait_for_idle
17 from .app import App, ReturnType
18 from .events import Click, MouseDown, MouseMove, MouseUp
19 from .widget import Widget
20 
21 
22 def _get_mouse_message_arguments(
23     target: Widget,
24     offset: tuple[int, int] = (0, 0),
25     button: int = 0,
26     shift: bool = False,
27     meta: bool = False,
28     control: bool = False,
29 ) -> dict[str, Any]:
30     """Get the arguments to pass into mouse messages for the click and hover methods."""
31     click_x, click_y = target.region.offset + offset
32     message_arguments = {
33         "x": click_x,
34         "y": click_y,
35         "delta_x": 0,
36         "delta_y": 0,
37         "button": button,
38         "shift": shift,
39         "meta": meta,
40         "ctrl": control,
41         "screen_x": click_x,
42         "screen_y": click_y,
43     }
44     return message_arguments
45 
46 
47 class WaitForScreenTimeout(Exception):
48     """Exception raised if messages aren't being processed quickly enough.
49 
50     If this occurs, the most likely explanation is some kind of deadlock in the app code.
51     """
52 
53 
54 @rich.repr.auto(angular=True)
55 class Pilot(Generic[ReturnType]):
56     """Pilot object to drive an app."""
57 
58     def __init__(self, app: App[ReturnType]) -> None:
59         self._app = app
60 
61     def __rich_repr__(self) -> rich.repr.Result:
62         yield "app", self._app
63 
64     @property
65     def app(self) -> App[ReturnType]:
66         """App: A reference to the application."""
67         return self._app
68 
69     async def press(self, *keys: str) -> None:
70         """Simulate key-presses.
71 
72         Args:
73             *keys: Keys to press.
74         """
75         if keys:
76             await self._app._press_keys(keys)
77             await self._wait_for_screen()
78 
79     async def click(
80         self,
81         selector: type[Widget] | str | None = None,
82         offset: tuple[int, int] = (0, 0),
83         shift: bool = False,
84         meta: bool = False,
85         control: bool = False,
86     ) -> None:
87         """Simulate clicking with the mouse.
88 
89         Args:
90             selector: The widget that should be clicked. If None, then the click
91                 will occur relative to the screen. Note that this simply causes
92                 a click to occur at the location of the widget. If the widget is
93                 currently hidden or obscured by another widget, then the click may
94                 not land on it.
95             offset: The offset to click within the selected widget.
96             shift: Click with the shift key held down.
97             meta: Click with the meta key held down.
98             control: Click with the control key held down.
99         """
100         app = self.app
101         screen = app.screen
102         if selector is not None:
103             target_widget = screen.query_one(selector)
104         else:
105             target_widget = screen
106 
107         message_arguments = _get_mouse_message_arguments(
108             target_widget, offset, button=1, shift=shift, meta=meta, control=control
109         )
110         app.post_message(MouseDown(**message_arguments))
111         await self.pause(0.1)
112         app.post_message(MouseUp(**message_arguments))
113         await self.pause(0.1)
114         app.post_message(Click(**message_arguments))
115         await self.pause(0.1)
116 
117     async def hover(
118         self,
119         selector: type[Widget] | str | None | None = None,
120         offset: tuple[int, int] = (0, 0),
121     ) -> None:
122         """Simulate hovering with the mouse cursor.
123 
124         Args:
125             selector: The widget that should be hovered. If None, then the click
126                 will occur relative to the screen. Note that this simply causes
127                 a hover to occur at the location of the widget. If the widget is
128                 currently hidden or obscured by another widget, then the hover may
129                 not land on it.
130             offset: The offset to hover over within the selected widget.
131         """
132         app = self.app
133         screen = app.screen
134         if selector is not None:
135             target_widget = screen.query_one(selector)
136         else:
137             target_widget = screen
138 
139         message_arguments = _get_mouse_message_arguments(
140             target_widget, offset, button=0
141         )
142         await self.pause()
143         app.post_message(MouseMove(**message_arguments))
144         await self.pause()
145 
146     async def _wait_for_screen(self, timeout: float = 30.0) -> bool:
147         """Wait for the current screen and its children to have processed all pending events.
148 
149         Args:
150             timeout: A timeout in seconds to wait.
151 
152         Returns:
153             `True` if all events were processed. `False` if an exception occurred,
154             meaning that not all events could be processed.
155 
156         Raises:
157             WaitForScreenTimeout: If the screen and its children didn't finish processing within the timeout.
158         """
159         children = [self.app, *self.app.screen.walk_children(with_self=True)]
160         count = 0
161         count_zero_event = asyncio.Event()
162 
163         def decrement_counter() -> None:
164             """Decrement internal counter, and set an event if it reaches zero."""
165             nonlocal count
166             count -= 1
167             if count == 0:
168                 # When count is zero, all messages queued at the start of the method have been processed
169                 count_zero_event.set()
170 
171         # Increase the count for every successful call_later
172         for child in children:
173             if child.call_later(decrement_counter):
174                 count += 1
175 
176         if count:
177             # Wait for the count to return to zero, or a timeout, or an exception
178             wait_for = [
179                 asyncio.create_task(count_zero_event.wait()),
180                 asyncio.create_task(self.app._exception_event.wait()),
181             ]
182             _, pending = await asyncio.wait(
183                 wait_for,
184                 timeout=timeout,
185                 return_when=asyncio.FIRST_COMPLETED,
186             )
187 
188             for task in pending:
189                 task.cancel()
190 
191             timed_out = len(wait_for) == len(pending)
192             if timed_out:
193                 raise WaitForScreenTimeout(
194                     "Timed out while waiting for widgets to process pending messages."
195                 )
196 
197             # We've either timed out, encountered an exception, or we've finished
198             # decrementing all the counters (all events processed in children).
199             if count > 0:
200                 return False
201 
202         return True
203 
204     async def pause(self, delay: float | None = None) -> None:
205         """Insert a pause.
206 
207         Args:
208             delay: Seconds to pause, or None to wait for cpu idle.
209         """
210         # These sleep zeros, are to force asyncio to give up a time-slice.
211         await self._wait_for_screen()
212         if delay is None:
213             await wait_for_idle(0)
214         else:
215             await asyncio.sleep(delay)
216         self.app.screen._on_timer_update()
217 
218     async def wait_for_animation(self) -> None:
219         """Wait for any current animation to complete."""
220         await self._app.animator.wait_for_idle()
221         self.app.screen._on_timer_update()
222 
223     async def wait_for_scheduled_animations(self) -> None:
224         """Wait for any current and scheduled animations to complete."""
225         await self._wait_for_screen()
226         await self._app.animator.wait_until_complete()
227         await self._wait_for_screen()
228         await wait_for_idle()
229         self.app.screen._on_timer_update()
230 
231     async def exit(self, result: ReturnType) -> None:
232         """Exit the app with the given result.
233 
234         Args:
235             result: The app result returned by `run` or `run_async`.
236         """
237         await self._wait_for_screen()
238         await wait_for_idle()
239         self.app.exit(result)
240
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/textual/pilot.py b/src/textual/pilot.py
--- a/src/textual/pilot.py
+++ b/src/textual/pilot.py
@@ -100,7 +100,7 @@
         app = self.app
         screen = app.screen
         if selector is not None:
-            target_widget = screen.query_one(selector)
+            target_widget = app.query_one(selector)
         else:
             target_widget = screen
 
@@ -132,7 +132,7 @@
         app = self.app
         screen = app.screen
         if selector is not None:
-            target_widget = screen.query_one(selector)
+            target_widget = app.query_one(selector)
         else:
             target_widget = screen

{"golden_diff": "diff --git a/src/textual/pilot.py b/src/textual/pilot.py\n--- a/src/textual/pilot.py\n+++ b/src/textual/pilot.py\n@@ -100,7 +100,7 @@\n         app = self.app\n         screen = app.screen\n         if selector is not None:\n-            target_widget = screen.query_one(selector)\n+            target_widget = app.query_one(selector)\n         else:\n             target_widget = screen\n \n@@ -132,7 +132,7 @@\n         app = self.app\n         screen = app.screen\n         if selector is not None:\n-            target_widget = screen.query_one(selector)\n+            target_widget = app.query_one(selector)\n         else:\n             target_widget = screen\n", "issue": "Pilot.click can't use `Screen` as selector.\nIf you try something like `pilot.click(Screen)`, you get a `NoMatches` exception from the query.\nPilot.click can't use `Screen` as selector.\nIf you try something like `pilot.click(Screen)`, you get a `NoMatches` exception from the query.\n", "before_files": [{"content": "\"\"\"\n\nThe pilot object is used by [App.run_test][textual.app.App.run_test] to programmatically operate an app.\n\nSee the guide on how to [test Textual apps](/guide/testing).\n\n\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nfrom typing import Any, Generic\n\nimport rich.repr\n\nfrom ._wait import wait_for_idle\nfrom .app import App, ReturnType\nfrom .events import Click, MouseDown, MouseMove, MouseUp\nfrom .widget import Widget\n\n\ndef _get_mouse_message_arguments(\n    target: Widget,\n    offset: tuple[int, int] = (0, 0),\n    button: int = 0,\n    shift: bool = False,\n    meta: bool = False,\n    control: bool = False,\n) -> dict[str, Any]:\n    \"\"\"Get the arguments to pass into mouse messages for the click and hover methods.\"\"\"\n    click_x, click_y = target.region.offset + offset\n    message_arguments = {\n        \"x\": click_x,\n        \"y\": click_y,\n        \"delta_x\": 0,\n        \"delta_y\": 0,\n        \"button\": button,\n        \"shift\": shift,\n        \"meta\": meta,\n        \"ctrl\": control,\n        \"screen_x\": click_x,\n        \"screen_y\": click_y,\n    }\n    return message_arguments\n\n\nclass WaitForScreenTimeout(Exception):\n    \"\"\"Exception raised if messages aren't being processed quickly enough.\n\n    If this occurs, the most likely explanation is some kind of deadlock in the app code.\n    \"\"\"\n\n\n@rich.repr.auto(angular=True)\nclass Pilot(Generic[ReturnType]):\n    \"\"\"Pilot object to drive an app.\"\"\"\n\n    def __init__(self, app: App[ReturnType]) -> None:\n        self._app = app\n\n    def __rich_repr__(self) -> rich.repr.Result:\n        yield \"app\", self._app\n\n    @property\n    def app(self) -> App[ReturnType]:\n        \"\"\"App: A reference to the application.\"\"\"\n        return self._app\n\n    async def press(self, *keys: str) -> None:\n        \"\"\"Simulate key-presses.\n\n        Args:\n            *keys: Keys to press.\n        \"\"\"\n        if keys:\n            await self._app._press_keys(keys)\n            await self._wait_for_screen()\n\n    async def click(\n        self,\n        selector: type[Widget] | str | None = None,\n        offset: tuple[int, int] = (0, 0),\n        shift: bool = False,\n        meta: bool = False,\n        control: bool = False,\n    ) -> None:\n        \"\"\"Simulate clicking with the mouse.\n\n        Args:\n            selector: The widget that should be clicked. If None, then the click\n                will occur relative to the screen. Note that this simply causes\n                a click to occur at the location of the widget. If the widget is\n                currently hidden or obscured by another widget, then the click may\n                not land on it.\n            offset: The offset to click within the selected widget.\n            shift: Click with the shift key held down.\n            meta: Click with the meta key held down.\n            control: Click with the control key held down.\n        \"\"\"\n        app = self.app\n        screen = app.screen\n        if selector is not None:\n            target_widget = screen.query_one(selector)\n        else:\n            target_widget = screen\n\n        message_arguments = _get_mouse_message_arguments(\n            target_widget, offset, button=1, shift=shift, meta=meta, control=control\n        )\n        app.post_message(MouseDown(**message_arguments))\n        await self.pause(0.1)\n        app.post_message(MouseUp(**message_arguments))\n        await self.pause(0.1)\n        app.post_message(Click(**message_arguments))\n        await self.pause(0.1)\n\n    async def hover(\n        self,\n        selector: type[Widget] | str | None | None = None,\n        offset: tuple[int, int] = (0, 0),\n    ) -> None:\n        \"\"\"Simulate hovering with the mouse cursor.\n\n        Args:\n            selector: The widget that should be hovered. If None, then the click\n                will occur relative to the screen. Note that this simply causes\n                a hover to occur at the location of the widget. If the widget is\n                currently hidden or obscured by another widget, then the hover may\n                not land on it.\n            offset: The offset to hover over within the selected widget.\n        \"\"\"\n        app = self.app\n        screen = app.screen\n        if selector is not None:\n            target_widget = screen.query_one(selector)\n        else:\n            target_widget = screen\n\n        message_arguments = _get_mouse_message_arguments(\n            target_widget, offset, button=0\n        )\n        await self.pause()\n        app.post_message(MouseMove(**message_arguments))\n        await self.pause()\n\n    async def _wait_for_screen(self, timeout: float = 30.0) -> bool:\n        \"\"\"Wait for the current screen and its children to have processed all pending events.\n\n        Args:\n            timeout: A timeout in seconds to wait.\n\n        Returns:\n            `True` if all events were processed. `False` if an exception occurred,\n            meaning that not all events could be processed.\n\n        Raises:\n            WaitForScreenTimeout: If the screen and its children didn't finish processing within the timeout.\n        \"\"\"\n        children = [self.app, *self.app.screen.walk_children(with_self=True)]\n        count = 0\n        count_zero_event = asyncio.Event()\n\n        def decrement_counter() -> None:\n            \"\"\"Decrement internal counter, and set an event if it reaches zero.\"\"\"\n            nonlocal count\n            count -= 1\n            if count == 0:\n                # When count is zero, all messages queued at the start of the method have been processed\n                count_zero_event.set()\n\n        # Increase the count for every successful call_later\n        for child in children:\n            if child.call_later(decrement_counter):\n                count += 1\n\n        if count:\n            # Wait for the count to return to zero, or a timeout, or an exception\n            wait_for = [\n                asyncio.create_task(count_zero_event.wait()),\n                asyncio.create_task(self.app._exception_event.wait()),\n            ]\n            _, pending = await asyncio.wait(\n                wait_for,\n                timeout=timeout,\n                return_when=asyncio.FIRST_COMPLETED,\n            )\n\n            for task in pending:\n                task.cancel()\n\n            timed_out = len(wait_for) == len(pending)\n            if timed_out:\n                raise WaitForScreenTimeout(\n                    \"Timed out while waiting for widgets to process pending messages.\"\n                )\n\n            # We've either timed out, encountered an exception, or we've finished\n            # decrementing all the counters (all events processed in children).\n            if count > 0:\n                return False\n\n        return True\n\n    async def pause(self, delay: float | None = None) -> None:\n        \"\"\"Insert a pause.\n\n        Args:\n            delay: Seconds to pause, or None to wait for cpu idle.\n        \"\"\"\n        # These sleep zeros, are to force asyncio to give up a time-slice.\n        await self._wait_for_screen()\n        if delay is None:\n            await wait_for_idle(0)\n        else:\n            await asyncio.sleep(delay)\n        self.app.screen._on_timer_update()\n\n    async def wait_for_animation(self) -> None:\n        \"\"\"Wait for any current animation to complete.\"\"\"\n        await self._app.animator.wait_for_idle()\n        self.app.screen._on_timer_update()\n\n    async def wait_for_scheduled_animations(self) -> None:\n        \"\"\"Wait for any current and scheduled animations to complete.\"\"\"\n        await self._wait_for_screen()\n        await self._app.animator.wait_until_complete()\n        await self._wait_for_screen()\n        await wait_for_idle()\n        self.app.screen._on_timer_update()\n\n    async def exit(self, result: ReturnType) -> None:\n        \"\"\"Exit the app with the given result.\n\n        Args:\n            result: The app result returned by `run` or `run_async`.\n        \"\"\"\n        await self._wait_for_screen()\n        await wait_for_idle()\n        self.app.exit(result)\n", "path": "src/textual/pilot.py"}], "after_files": [{"content": "\"\"\"\n\nThe pilot object is used by [App.run_test][textual.app.App.run_test] to programmatically operate an app.\n\nSee the guide on how to [test Textual apps](/guide/testing).\n\n\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nfrom typing import Any, Generic\n\nimport rich.repr\n\nfrom ._wait import wait_for_idle\nfrom .app import App, ReturnType\nfrom .events import Click, MouseDown, MouseMove, MouseUp\nfrom .widget import Widget\n\n\ndef _get_mouse_message_arguments(\n    target: Widget,\n    offset: tuple[int, int] = (0, 0),\n    button: int = 0,\n    shift: bool = False,\n    meta: bool = False,\n    control: bool = False,\n) -> dict[str, Any]:\n    \"\"\"Get the arguments to pass into mouse messages for the click and hover methods.\"\"\"\n    click_x, click_y = target.region.offset + offset\n    message_arguments = {\n        \"x\": click_x,\n        \"y\": click_y,\n        \"delta_x\": 0,\n        \"delta_y\": 0,\n        \"button\": button,\n        \"shift\": shift,\n        \"meta\": meta,\n        \"ctrl\": control,\n        \"screen_x\": click_x,\n        \"screen_y\": click_y,\n    }\n    return message_arguments\n\n\nclass WaitForScreenTimeout(Exception):\n    \"\"\"Exception raised if messages aren't being processed quickly enough.\n\n    If this occurs, the most likely explanation is some kind of deadlock in the app code.\n    \"\"\"\n\n\n@rich.repr.auto(angular=True)\nclass Pilot(Generic[ReturnType]):\n    \"\"\"Pilot object to drive an app.\"\"\"\n\n    def __init__(self, app: App[ReturnType]) -> None:\n        self._app = app\n\n    def __rich_repr__(self) -> rich.repr.Result:\n        yield \"app\", self._app\n\n    @property\n    def app(self) -> App[ReturnType]:\n        \"\"\"App: A reference to the application.\"\"\"\n        return self._app\n\n    async def press(self, *keys: str) -> None:\n        \"\"\"Simulate key-presses.\n\n        Args:\n            *keys: Keys to press.\n        \"\"\"\n        if keys:\n            await self._app._press_keys(keys)\n            await self._wait_for_screen()\n\n    async def click(\n        self,\n        selector: type[Widget] | str | None = None,\n        offset: tuple[int, int] = (0, 0),\n        shift: bool = False,\n        meta: bool = False,\n        control: bool = False,\n    ) -> None:\n        \"\"\"Simulate clicking with the mouse.\n\n        Args:\n            selector: The widget that should be clicked. If None, then the click\n                will occur relative to the screen. Note that this simply causes\n                a click to occur at the location of the widget. If the widget is\n                currently hidden or obscured by another widget, then the click may\n                not land on it.\n            offset: The offset to click within the selected widget.\n            shift: Click with the shift key held down.\n            meta: Click with the meta key held down.\n            control: Click with the control key held down.\n        \"\"\"\n        app = self.app\n        screen = app.screen\n        if selector is not None:\n            target_widget = app.query_one(selector)\n        else:\n            target_widget = screen\n\n        message_arguments = _get_mouse_message_arguments(\n            target_widget, offset, button=1, shift=shift, meta=meta, control=control\n        )\n        app.post_message(MouseDown(**message_arguments))\n        await self.pause(0.1)\n        app.post_message(MouseUp(**message_arguments))\n        await self.pause(0.1)\n        app.post_message(Click(**message_arguments))\n        await self.pause(0.1)\n\n    async def hover(\n        self,\n        selector: type[Widget] | str | None | None = None,\n        offset: tuple[int, int] = (0, 0),\n    ) -> None:\n        \"\"\"Simulate hovering with the mouse cursor.\n\n        Args:\n            selector: The widget that should be hovered. If None, then the click\n                will occur relative to the screen. Note that this simply causes\n                a hover to occur at the location of the widget. If the widget is\n                currently hidden or obscured by another widget, then the hover may\n                not land on it.\n            offset: The offset to hover over within the selected widget.\n        \"\"\"\n        app = self.app\n        screen = app.screen\n        if selector is not None:\n            target_widget = app.query_one(selector)\n        else:\n            target_widget = screen\n\n        message_arguments = _get_mouse_message_arguments(\n            target_widget, offset, button=0\n        )\n        await self.pause()\n        app.post_message(MouseMove(**message_arguments))\n        await self.pause()\n\n    async def _wait_for_screen(self, timeout: float = 30.0) -> bool:\n        \"\"\"Wait for the current screen and its children to have processed all pending events.\n\n        Args:\n            timeout: A timeout in seconds to wait.\n\n        Returns:\n            `True` if all events were processed. `False` if an exception occurred,\n            meaning that not all events could be processed.\n\n        Raises:\n            WaitForScreenTimeout: If the screen and its children didn't finish processing within the timeout.\n        \"\"\"\n        children = [self.app, *self.app.screen.walk_children(with_self=True)]\n        count = 0\n        count_zero_event = asyncio.Event()\n\n        def decrement_counter() -> None:\n            \"\"\"Decrement internal counter, and set an event if it reaches zero.\"\"\"\n            nonlocal count\n            count -= 1\n            if count == 0:\n                # When count is zero, all messages queued at the start of the method have been processed\n                count_zero_event.set()\n\n        # Increase the count for every successful call_later\n        for child in children:\n            if child.call_later(decrement_counter):\n                count += 1\n\n        if count:\n            # Wait for the count to return to zero, or a timeout, or an exception\n            wait_for = [\n                asyncio.create_task(count_zero_event.wait()),\n                asyncio.create_task(self.app._exception_event.wait()),\n            ]\n            _, pending = await asyncio.wait(\n                wait_for,\n                timeout=timeout,\n                return_when=asyncio.FIRST_COMPLETED,\n            )\n\n            for task in pending:\n                task.cancel()\n\n            timed_out = len(wait_for) == len(pending)\n            if timed_out:\n                raise WaitForScreenTimeout(\n                    \"Timed out while waiting for widgets to process pending messages.\"\n                )\n\n            # We've either timed out, encountered an exception, or we've finished\n            # decrementing all the counters (all events processed in children).\n            if count > 0:\n                return False\n\n        return True\n\n    async def pause(self, delay: float | None = None) -> None:\n        \"\"\"Insert a pause.\n\n        Args:\n            delay: Seconds to pause, or None to wait for cpu idle.\n        \"\"\"\n        # These sleep zeros, are to force asyncio to give up a time-slice.\n        await self._wait_for_screen()\n        if delay is None:\n            await wait_for_idle(0)\n        else:\n            await asyncio.sleep(delay)\n        self.app.screen._on_timer_update()\n\n    async def wait_for_animation(self) -> None:\n        \"\"\"Wait for any current animation to complete.\"\"\"\n        await self._app.animator.wait_for_idle()\n        self.app.screen._on_timer_update()\n\n    async def wait_for_scheduled_animations(self) -> None:\n        \"\"\"Wait for any current and scheduled animations to complete.\"\"\"\n        await self._wait_for_screen()\n        await self._app.animator.wait_until_complete()\n        await self._wait_for_screen()\n        await wait_for_idle()\n        self.app.screen._on_timer_update()\n\n    async def exit(self, result: ReturnType) -> None:\n        \"\"\"Exit the app with the given result.\n\n        Args:\n            result: The app result returned by `run` or `run_async`.\n        \"\"\"\n        await self._wait_for_screen()\n        await wait_for_idle()\n        self.app.exit(result)\n", "path": "src/textual/pilot.py"}]}