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

Method test_sentinel

Lib/test/_test_multiprocessing.py:737–751  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

735
736 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
737 def test_sentinel(self):
738 if self.TYPE == "threads":
739 self.skipTest('test not appropriate for {}'.format(self.TYPE))
740 event = self.Event()
741 p = self.Process(target=self._test_sentinel, args=(event,))
742 with self.assertRaises(ValueError):
743 p.sentinel
744 p.start()
745 self.addCleanup(p.join)
746 sentinel = p.sentinel
747 self.assertIsInstance(sentinel, int)
748 self.assertFalse(wait_for_handle(sentinel, timeout=0.0))
749 event.set()
750 p.join()
751 self.assertTrue(wait_for_handle(sentinel, timeout=1))
752
753 @classmethod
754 def _test_close(cls, rc=0, q=None):

Callers

nothing calls this directly

Calls 13

setMethod · 0.95
wait_for_handleFunction · 0.85
skipTestMethod · 0.80
EventMethod · 0.80
addCleanupMethod · 0.80
assertIsInstanceMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
formatMethod · 0.45
ProcessMethod · 0.45
assertRaisesMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected