Open
Description
Bug report
Bug description:
import multiprocessing
import unittest
from unittest import mock
class Hello(unittest.TestCase):
def _test_world(x):
print(x, World().test())
def test_world(self):
# OK: multiprocessing.set_start_method("fork")
# NOK: multiprocessing.set_start_method("forkserver")
with mock.patch.object(World, "test", return_value=42):
with multiprocessing.Pool(5) as pool:
pool.map(Hello._test_world, range(5))
class World:
def test(self):
return 1
With "fork":
test.py 0 42
1 42
2 42
3 42
4 42
With "forkserver":
test.py 0 1
1 1
2 1
4 1
3 1
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Projects
Status
Todo