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

Method test_spawn_close

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

Source from the content-addressed store, hash-verified

3491 self.assertRaises(OSError, writer.poll)
3492
3493 def test_spawn_close(self):
3494 # We test that a pipe connection can be closed by parent
3495 # process immediately after child is spawned. On Windows this
3496 # would have sometimes failed on old versions because
3497 # child_conn would be closed before the child got a chance to
3498 # duplicate it.
3499 conn, child_conn = self.Pipe()
3500
3501 p = self.Process(target=self._echo, args=(child_conn,))
3502 p.daemon = True
3503 p.start()
3504 child_conn.close() # this might complete before child initializes
3505
3506 msg = latin('hello')
3507 conn.send_bytes(msg)
3508 self.assertEqual(conn.recv_bytes(), msg)
3509
3510 conn.send_bytes(SENTINEL)
3511 conn.close()
3512 p.join()
3513
3514 def test_sendbytes(self):
3515 if self.TYPE != 'processes':

Callers

nothing calls this directly

Calls 9

latinFunction · 0.85
PipeMethod · 0.80
ProcessMethod · 0.45
startMethod · 0.45
closeMethod · 0.45
send_bytesMethod · 0.45
assertEqualMethod · 0.45
recv_bytesMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected