def test_join_timeout(self): task = test_task.post() thread = threading.Thread( target=lambda:task.join()) thread.daemon = True thread.start() # Do *not* run the task thread.join(0.01) self.assertEqual(thread.is_alive(), True)
def test_join_ok(self): task = test_task.post() thread = threading.Thread( target=lambda:task.join()) thread.daemon = True thread.start() task() thread.join(1) self.assertEqual(thread.is_alive(), False)