Skip to content

Commit 8183610

Browse files
author
astrand
committed
Only run extensive subprocess tests if -usubprocess to regrtest is specified. Fixes #1124637
git-svn-id: http://svn.python.org/projects/python/trunk@38557 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 93bf61d commit 8183610

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Lib/test/regrtest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
in the standard library and test suite. This takes
9494
a long time.
9595
96+
subprocess Run all tests for the subprocess module.
97+
9698
To enable all resources except one, use '-uall,-<resource>'. For
9799
example, to run all the tests except for the bsddb tests, give the
98100
option '-uall,-bsddb'.
@@ -136,7 +138,7 @@
136138
from test import test_support
137139

138140
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
139-
'decimal', 'compiler')
141+
'decimal', 'compiler', 'subprocess')
140142

141143

142144
def usage(code, msg=''):

Lib/test/test_subprocess.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,10 @@ def test_universal_newlines_communicate(self):
382382

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

0 commit comments

Comments
 (0)