Peter Astrand  committed 7a1a8ec

Only run extensive subprocess tests if -usubprocess to regrtest is specified. Fixes #1124637

  • Participants
  • Parent commits 0d4108d
  • Branches 2.4

Comments (0)

Files changed (2)

File Lib/test/

                 in the standard library and test suite.  This takes
                 a long time.
+    subprocess  Run all tests for the subprocess module. 
 To enable all resources except one, use '-uall,-<resource>'.  For
 example, to run all the tests except for the bsddb tests, give the
 option '-uall,-bsddb'.
 from test import test_support
 RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
-                  'decimal', 'compiler')
+                  'decimal', 'compiler', 'subprocess')
 def usage(code, msg=''):

File Lib/test/

     def test_no_leaking(self):
         # Make sure we leak no resources
-        max_handles = 1026 # too much for most UNIX systems
-        if mswindows:
-            max_handles = 65 # a full test is too slow on Windows
+        if test_support.is_resource_enabled("subprocess") and not mswindows:
+            max_handles = 1026 # too much for most UNIX systems
+        else:
+            max_handles = 65 
         for i in range(max_handles):
             p = subprocess.Popen([sys.executable, "-c",
                     "import sys;sys.stdout.write("],