Test the compaction's boundaries, an unreadable transcript, a usage limit and the timer's daemon thread
CI / tests (pull_request) Successful in 3m21s

This commit is contained in:
2026-11-19 04:11:13 +01:00
parent 444f5824d9
commit 30595cfdf4
2 changed files with 31 additions and 1 deletions
+7
View File
@@ -143,6 +143,13 @@ class Timer(unittest.TestCase):
start_timer(0.05, ran.set)
self.assertTrue(ran.wait(10))
def test_the_systems_timer_runs_on_a_daemon_thread_so_a_loop_that_exits_while_it_waits_does_not_wait_for_it(self):
self.assertIs(system_effects().timer, start_timer)
before = set(threading.enumerate())
stop = start_timer(60, lambda: None)
self.addCleanup(stop)
self.assertEqual([thread.daemon for thread in set(threading.enumerate()) - before], [True])
def test_a_timer_stopped_before_its_delay_has_passed_never_runs_the_action(self):
ran = threading.Event()
start_timer(0.2, ran.set)()