diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index ab6d92b2a5b..0429941d87d 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -380,8 +380,9 @@ class CompatPickleTests(unittest.TestCase): self.assertEqual(mapping('exceptions', name), ('builtins', name)) - import multiprocessing.context - for name, exc in get_exceptions(multiprocessing.context): + def test_multiprocessing_exceptions(self): + module = support.import_module('multiprocessing.context') + for name, exc in get_exceptions(module): with self.subTest(name): self.assertEqual(reverse_mapping('multiprocessing.context', name), ('multiprocessing', name))