summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-09-19 23:13:04 (GMT)
committerGitHub <noreply@github.com>2021-09-19 23:13:04 (GMT)
commit0e9608680525b120fc8eaad9f1cb2f729a6c22ae (patch)
treed94f677553d0fd62772461ef4116ef4917428a49 /Lib/test/test_logging.py
parentf17c979d909f05916e354ae54c82bff71dbede35 (diff)
downloadcpython-0e9608680525b120fc8eaad9f1cb2f729a6c22ae.zip
cpython-0e9608680525b120fc8eaad9f1cb2f729a6c22ae.tar.gz
cpython-0e9608680525b120fc8eaad9f1cb2f729a6c22ae.tar.bz2
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)
(cherry picked from commit 1d42408495402b06ecae91420735aeff454be6b5) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index c969a3f..8356e6b 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -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