mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Only run extensive subprocess tests if -usubprocess to regrtest is specified. Fixes #1124637
This commit is contained in:
parent
23109f0009
commit
f7f1bb7ff5
2 changed files with 7 additions and 4 deletions
|
@ -93,6 +93,8 @@ resources to test. Currently only the following are defined:
|
||||||
in the standard library and test suite. This takes
|
in the standard library and test suite. This takes
|
||||||
a long time.
|
a long time.
|
||||||
|
|
||||||
|
subprocess Run all tests for the subprocess module.
|
||||||
|
|
||||||
To enable all resources except one, use '-uall,-<resource>'. For
|
To enable all resources except one, use '-uall,-<resource>'. For
|
||||||
example, to run all the tests except for the bsddb tests, give the
|
example, to run all the tests except for the bsddb tests, give the
|
||||||
option '-uall,-bsddb'.
|
option '-uall,-bsddb'.
|
||||||
|
@ -136,7 +138,7 @@ if sys.platform == 'darwin':
|
||||||
from test import test_support
|
from test import test_support
|
||||||
|
|
||||||
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
|
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
|
||||||
'decimal', 'compiler')
|
'decimal', 'compiler', 'subprocess')
|
||||||
|
|
||||||
|
|
||||||
def usage(code, msg=''):
|
def usage(code, msg=''):
|
||||||
|
|
|
@ -382,9 +382,10 @@ class ProcessTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def test_no_leaking(self):
|
def test_no_leaking(self):
|
||||||
# Make sure we leak no resources
|
# Make sure we leak no resources
|
||||||
|
if test_support.is_resource_enabled("subprocess") and not mswindows:
|
||||||
max_handles = 1026 # too much for most UNIX systems
|
max_handles = 1026 # too much for most UNIX systems
|
||||||
if mswindows:
|
else:
|
||||||
max_handles = 65 # a full test is too slow on Windows
|
max_handles = 65
|
||||||
for i in range(max_handles):
|
for i in range(max_handles):
|
||||||
p = subprocess.Popen([sys.executable, "-c",
|
p = subprocess.Popen([sys.executable, "-c",
|
||||||
"import sys;sys.stdout.write(sys.stdin.read())"],
|
"import sys;sys.stdout.write(sys.stdin.read())"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue