mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)
This reverts the core of #100618 while leaving relevant documentation improvements and minor refactorings in place.
This commit is contained in:
parent
f6c53b80a1
commit
d4c410f0f9
11 changed files with 27 additions and 189 deletions
|
@ -18,7 +18,6 @@ import sys
|
|||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
import weakref
|
||||
from pickle import PicklingError
|
||||
|
||||
|
@ -572,24 +571,6 @@ class ProcessPoolShutdownTest(ExecutorShutdownTest):
|
|||
assert all([r == abs(v) for r, v in zip(res, range(-5, 5))])
|
||||
|
||||
|
||||
@unittest.skipIf(mp.get_all_start_methods()[0] != "fork", "non-fork default.")
|
||||
class ProcessPoolExecutorDefaultForkWarning(unittest.TestCase):
|
||||
def test_fork_default_warns(self):
|
||||
with self.assertWarns(mp.context.DefaultForkDeprecationWarning):
|
||||
with futures.ProcessPoolExecutor(2):
|
||||
pass
|
||||
|
||||
def test_explicit_fork_does_not_warn(self):
|
||||
with warnings.catch_warnings(record=True) as ws:
|
||||
warnings.simplefilter("ignore")
|
||||
warnings.filterwarnings(
|
||||
'always', category=mp.context.DefaultForkDeprecationWarning)
|
||||
ctx = mp.get_context("fork") # Non-default fork context.
|
||||
with futures.ProcessPoolExecutor(2, mp_context=ctx):
|
||||
pass
|
||||
self.assertEqual(len(ws), 0, msg=[str(x) for x in ws])
|
||||
|
||||
|
||||
create_executor_tests(ProcessPoolShutdownTest,
|
||||
executor_mixins=(ProcessPoolForkMixin,
|
||||
ProcessPoolForkserverMixin,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue