Test that the multiprocessing is able to spawn.
(self)
| 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): |
nothing calls this directly
no test coverage detected