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

Method test_dont_merge

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

Source from the content-addressed store, hash-verified

4126
4127 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
4128 def test_dont_merge(self):
4129 a, b = self.Pipe()
4130 self.assertEqual(a.poll(0.0), False)
4131 self.assertEqual(a.poll(0.1), False)
4132
4133 p = self.Process(target=self._child_dont_merge, args=(b,))
4134 p.start()
4135
4136 self.assertEqual(a.recv_bytes(), b'a')
4137 self.assertEqual(a.poll(1.0), True)
4138 self.assertEqual(a.poll(1.0), True)
4139 self.assertEqual(a.recv_bytes(), b'b')
4140 self.assertEqual(a.poll(1.0), True)
4141 self.assertEqual(a.poll(1.0), True)
4142 self.assertEqual(a.poll(0.0), True)
4143 self.assertEqual(a.recv_bytes(), b'cd')
4144
4145 p.join()
4146
4147#
4148# Test of sending connection and socket objects between processes

Callers

nothing calls this directly

Calls 7

PipeMethod · 0.80
assertEqualMethod · 0.45
pollMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
recv_bytesMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected