MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sentinel

Method test_sentinel

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

Source from the content-addressed store, hash-verified

647 event.wait(10.0)
648
649 def test_sentinel(self):
650 if self.TYPE == "threads":
651 self.skipTest('test not appropriate for {}'.format(self.TYPE))
652 event = self.Event()
653 p = self.Process(target=self._test_sentinel, args=(event,))
654 with self.assertRaises(ValueError):
655 p.sentinel
656 p.start()
657 self.addCleanup(p.join)
658 sentinel = p.sentinel
659 self.assertIsInstance(sentinel, int)
660 self.assertFalse(wait_for_handle(sentinel, timeout=0.0))
661 event.set()
662 p.join()
663 self.assertTrue(wait_for_handle(sentinel, timeout=1))
664
665 @classmethod
666 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