diff options
Diffstat (limited to 'Lib/test')
| -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 5794b75..af841d6 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 |
