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

Method test_multiprocessing

Lib/test/test_venv.py:611–627  ·  view source on GitHub ↗

Test that the multiprocessing is able to spawn.

(self)

Source from the content-addressed store, hash-verified

609
610 @requireVenvCreate
611 def test_multiprocessing(self):
612 """
613 Test that the multiprocessing is able to spawn.
614 """
615 # bpo-36342: Instantiation of a Pool object imports the
616 # multiprocessing.synchronize module. Skip the test if this module
617 # cannot be imported.
618 skip_if_broken_multiprocessing_synchronize()
619
620 rmtree(self.env_dir)
621 self.run_with_capture(venv.create, self.env_dir)
622 out, err = check_output([self.envpy(real_env_dir=True), '-c',
623 'from multiprocessing import Pool; '
624 'pool = Pool(1); '
625 'print(pool.apply_async("Python".lower).get(3)); '
626 'pool.terminate()'])
627 self.assertEqual(out.strip(), "python".encode())
628
629 @requireVenvCreate
630 def test_multiprocessing_recursion(self):

Callers

nothing calls this directly

Calls 8

rmtreeFunction · 0.90
run_with_captureMethod · 0.80
envpyMethod · 0.80
check_outputFunction · 0.70
assertEqualMethod · 0.45
stripMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected