]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-119819: Conditional skip of logging tests that require multiprocessing subprocess...
authorRussell Keith-Magee <russell@keith-magee.com>
Sat, 15 Jun 2024 00:05:18 +0000 (08:05 +0800)
committerGitHub <noreply@github.com>
Sat, 15 Jun 2024 00:05:18 +0000 (08:05 +0800)
Skip tests that require multiprocessing subprocess support.

Lib/test/test_logging.py

index ef2d4a621be9626cba98ed3e1ac6e17fcacde79b..504862ad53395e6cdcac641b55110eaf9d1ea5b8 100644 (file)
@@ -3898,6 +3898,7 @@ class ConfigDictTest(BaseTest):
                 self.addCleanup(os.remove, fn)
 
     @threading_helper.requires_working_threading()
+    @support.requires_subprocess()
     def test_config_queue_handler(self):
         q = CustomQueue()
         dq = {
@@ -3926,12 +3927,10 @@ class ConfigDictTest(BaseTest):
             msg = str(ctx.exception)
             self.assertEqual(msg, "Unable to configure handler 'ah'")
 
+    @support.requires_subprocess()
     def test_multiprocessing_queues(self):
         # See gh-119819
 
-        # will skip test if it's not available
-        import_helper.import_module('_multiprocessing')
-
         cd = copy.deepcopy(self.config_queue_handler)
         from multiprocessing import Queue as MQ, Manager as MM
         q1 = MQ()  # this can't be pickled