diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-09-19 23:13:04 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-19 23:13:04 (GMT) |
| commit | 0e9608680525b120fc8eaad9f1cb2f729a6c22ae (patch) | |
| tree | d94f677553d0fd62772461ef4116ef4917428a49 /Lib/test/test_logging.py | |
| parent | f17c979d909f05916e354ae54c82bff71dbede35 (diff) | |
| download | cpython-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.py | 7 |
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 |
