MCPcopy Index your code
hub / github.com/python/cpython / test_shutdown_get_task_done_join

Method test_shutdown_get_task_done_join

Lib/test/test_queue.py:615–638  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

613 return self._shutdown_put_join(False)
614
615 def test_shutdown_get_task_done_join(self):
616 q = self.type2test(2)
617 results = []
618 go = threading.Event()
619 q.put("Y")
620 q.put("D")
621 self.assertEqual(q.unfinished_tasks, q.qsize())
622
623 thrds = (
624 (self._get_task_done, (q, go, results)),
625 (self._get_task_done, (q, go, results)),
626 (self._join, (q, results)),
627 (self._join, (q, results)),
628 )
629 threads = []
630 for func, params in thrds:
631 threads.append(threading.Thread(target=func, args=params))
632 threads[-1].start()
633 go.set()
634 q.shutdown(False)
635 for t in threads:
636 t.join()
637
638 self.assertEqual(results, [True]*len(thrds))
639
640 def test_shutdown_pending_get(self):
641 def get():

Callers

nothing calls this directly

Calls 10

setMethod · 0.95
type2testMethod · 0.80
EventMethod · 0.80
putMethod · 0.45
assertEqualMethod · 0.45
qsizeMethod · 0.45
appendMethod · 0.45
startMethod · 0.45
shutdownMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected