mirror of https://github.com/python/cpython
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)
This commit is contained in:
parent
e6d05a4092
commit
1d42408495
|
@ -4437,8 +4437,10 @@ class LogRecordTest(BaseTest):
|
|||
name = mp.current_process().name
|
||||
|
||||
r1 = logging.makeLogRecord({'msg': f'msg1_{key}'})
|
||||
del sys.modules['multiprocessing']
|
||||
r2 = logging.makeLogRecord({'msg': f'msg2_{key}'})
|
||||
|
||||
# https://bugs.python.org/issue45128
|
||||
with support.swap_item(sys.modules, 'multiprocessing', None):
|
||||
r2 = logging.makeLogRecord({'msg': f'msg2_{key}'})
|
||||
|
||||
results = {'processName' : name,
|
||||
'r1.processName': r1.processName,
|
||||
|
@ -4487,7 +4489,6 @@ class LogRecordTest(BaseTest):
|
|||
if multiprocessing_imported:
|
||||
import multiprocessing
|
||||
|
||||
|
||||
def test_optional(self):
|
||||
r = logging.makeLogRecord({})
|
||||
NOT_NONE = self.assertIsNotNone
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Fix ``test_multiprocessing_fork`` failure due to ``test_logging`` and
|
||||
``sys.modules`` manipulation.
|
Loading…
Reference in New Issue