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

Method test_multiprocessing

Lib/test/test_venv.py:609–625  ·  view source on GitHub ↗

Test that the multiprocessing is able to spawn.

(self)

Source from the content-addressed store, hash-verified

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