Esempio n. 1
0
 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)
Esempio n. 2
0
 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)