From 52a8d80d01cdd9b041eefeb927a77a61652954e5 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 30 Jul 2024 16:26:54 +0100 Subject: [PATCH] simplify test --- tests/test_await_remove.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_await_remove.py b/tests/test_await_remove.py index c6630afab..3b380e08b 100644 --- a/tests/test_await_remove.py +++ b/tests/test_await_remove.py @@ -3,8 +3,8 @@ from textual.widgets import Label class SelfRemovingLabel(Label): - def on_mount(self) -> None: - self.set_timer(0.2, self.remove) + async def on_mount(self) -> None: + await self.remove() class RemoveOnTimerApp(App[None]): @@ -17,6 +17,5 @@ async def test_multiple_simultaneous_removals(): """Regression test for https://github.com/Textualize/textual/issues/2854.""" # The app should run and finish without raising any errors. async with RemoveOnTimerApp().run_test() as pilot: - await pilot.pause(0.3) # Sanity check to ensure labels were removed. assert len(pilot.app.query(Label)) == 0