mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-45128: fixes test_multiprocessing_fork
mysterious crash (GH-28387)
(cherry picked from commit 1d42408495
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
f17c979d90
commit
0e96086805
2 changed files with 6 additions and 3 deletions
|
@ -4421,8 +4421,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,
|
||||
|
@ -4471,7 +4473,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…
Add table
Add a link
Reference in a new issue