From 708347382b7734fc6726abd63112de5a97f30d62 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 19 Nov 2026 04:44:37 +0100 Subject: [PATCH] Check the stopped timer once stop returns, not after a wait --- bin/loop_effects/test_effects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/loop_effects/test_effects.py b/bin/loop_effects/test_effects.py index f1e98449..6ee8f18b 100644 --- a/bin/loop_effects/test_effects.py +++ b/bin/loop_effects/test_effects.py @@ -152,8 +152,9 @@ class Timer(unittest.TestCase): def test_a_timer_stopped_before_its_delay_has_passed_never_runs_the_action(self): ran = threading.Event() + # stop returns once the timer's thread has ended, so the action cannot run later. start_timer(0.2, ran.set)() - self.assertFalse(ran.wait(0.5)) + self.assertFalse(ran.is_set()) def test_stopping_a_timer_whose_action_runs_waits_for_the_action_to_end(self): started, ended = threading.Event(), threading.Event()