summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-12-16 15:19:27 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2009-12-16 15:19:27 (GMT)
commitef1992b9fbcfb1dae7e946bfc42403fcaae9f044 (patch)
treefa292c49870bcf10ad57e7ffc2443a8353ba65b9
parent1f2a1ae3884ef6a59861928eedbf11730b567202 (diff)
downloadcpython-ef1992b9fbcfb1dae7e946bfc42403fcaae9f044.zip
cpython-ef1992b9fbcfb1dae7e946bfc42403fcaae9f044.tar.gz
cpython-ef1992b9fbcfb1dae7e946bfc42403fcaae9f044.tar.bz2
Merged revisions 76856 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76856 | r.david.murray | 2009-12-16 06:49:46 -0500 (Wed, 16 Dec 2009) | 2 lines Issue #7396: fix -s, which was broken by the -j enhancement. ........
-rwxr-xr-xLib/test/regrtest.py20
-rw-r--r--Misc/NEWS2
2 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index d4f228a..0664856 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -434,9 +434,14 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
stdtests.remove(arg)
nottests.add(arg)
args = []
- tests = tests or args or findtests(testdir, stdtests, nottests)
+ alltests = findtests(testdir, stdtests, nottests)
+ tests = tests or args or alltests
if single:
tests = tests[:1]
+ try:
+ next_single_test = alltests[alltests.index(tests[0])+1]
+ except IndexError:
+ next_single_test = None
# Remove all the tests that precede start if it's set.
if start:
try:
@@ -650,16 +655,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
raise
if single:
- alltests = findtests(testdir, stdtests, nottests)
- for i in range(len(alltests)):
- if tests[0] == alltests[i]:
- if i == len(alltests) - 1:
- os.unlink(filename)
- else:
- fp = open(filename, 'w')
- fp.write(alltests[i+1] + '\n')
- fp.close()
- break
+ if next_single_test:
+ with open(filename, 'w') as fp:
+ fp.write(next_single_test + '\n')
else:
os.unlink(filename)
diff --git a/Misc/NEWS b/Misc/NEWS
index f10f0c9..4ad3773 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -508,6 +508,8 @@ Documentation
Tests
-----
+- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
+
- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
instead of a hardcoded port number in test_rapid_restart.