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