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

Method test_pickling

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

Source from the content-addressed store, hash-verified

4195
4196 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
4197 def test_pickling(self):
4198 families = self.connection.families
4199
4200 lconn, lconn0 = self.Pipe()
4201 lp = self.Process(target=self._listener, args=(lconn0, families))
4202 lp.daemon = True
4203 lp.start()
4204 lconn0.close()
4205
4206 rconn, rconn0 = self.Pipe()
4207 rp = self.Process(target=self._remote, args=(rconn0,))
4208 rp.daemon = True
4209 rp.start()
4210 rconn0.close()
4211
4212 for fam in families:
4213 msg = ('This connection uses family %s' % fam).encode('ascii')
4214 address = lconn.recv()
4215 rconn.send((address, msg))
4216 new_conn = lconn.recv()
4217 self.assertEqual(new_conn.recv(), msg.upper())
4218
4219 rconn.send(None)
4220
4221 msg = latin('This connection uses a normal socket')
4222 address = lconn.recv()
4223 rconn.send((address, msg))
4224 new_conn = lconn.recv()
4225 buf = []
4226 while True:
4227 s = new_conn.recv(100)
4228 if not s:
4229 break
4230 buf.append(s)
4231 buf = b''.join(buf)
4232 self.assertEqual(buf, msg.upper())
4233 new_conn.close()
4234
4235 lconn.send(None)
4236
4237 rconn.close()
4238 lconn.close()
4239
4240 lp.join()
4241 rp.join()
4242
4243 @classmethod
4244 def child_access(cls, conn):

Callers

nothing calls this directly

Calls 12

latinFunction · 0.85
PipeMethod · 0.80
ProcessMethod · 0.45
startMethod · 0.45
closeMethod · 0.45
encodeMethod · 0.45
recvMethod · 0.45
sendMethod · 0.45
assertEqualMethod · 0.45
upperMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected