mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
Merged revisions 86542,87136,87216,87221,87228,87256,87337-87338,87372,87516,87571,88164 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86542 | r.david.murray | 2010-11-19 22:48:58 -0500 (Fri, 19 Nov 2010) | 2 lines Make test class name unique so that both test classes run. ........ r87136 | r.david.murray | 2010-12-08 17:53:00 -0500 (Wed, 08 Dec 2010) | 6 lines Have script_helper._assert_python strip refcount strings from stderr. This makes the output of the function and those that depend on it independent of whether or not they are being run under a debug build. ........ r87216 | r.david.murray | 2010-12-13 17:50:30 -0500 (Mon, 13 Dec 2010) | 2 lines #10698: fix typo in example. ........ r87221 | r.david.murray | 2010-12-13 19:55:46 -0500 (Mon, 13 Dec 2010) | 4 lines #10699: fix docstring for tzset: it does not take a parameter Thanks to Garrett Cooper for the fix. ........ r87228 | r.david.murray | 2010-12-13 21:25:43 -0500 (Mon, 13 Dec 2010) | 2 lines Turn on regrtest -W (rerun immediately) option for Windows, too. ........ r87256 | r.david.murray | 2010-12-14 21:19:14 -0500 (Tue, 14 Dec 2010) | 2 lines #10705: document what the values of debuglevel are and mean. ........ r87337 | r.david.murray | 2010-12-17 11:11:40 -0500 (Fri, 17 Dec 2010) | 2 lines #10559: provide instructions for accessing sys.argv when first mentioned. ........ r87338 | r.david.murray | 2010-12-17 11:29:07 -0500 (Fri, 17 Dec 2010) | 2 lines #10454: clarify the compileall docs and help messages. [changes to compileall.py were not backported, only the doc changes] ........ r87372 | r.david.murray | 2010-12-18 11:39:06 -0500 (Sat, 18 Dec 2010) | 2 lines #10728: the default for printing help is sys.stdout, not stderr. ........ r87516 | r.david.murray | 2010-12-27 15:09:32 -0500 (Mon, 27 Dec 2010) | 5 lines #7056: runtest and runtest_inner don't use testdir, so drop it from their sigs I've only tested regular runs and -j runs. If I've broken anything else I'm sure I'll hear about it sooner or later. ........ r87571 | r.david.murray | 2010-12-29 14:06:48 -0500 (Wed, 29 Dec 2010) | 2 lines Fix same typo in docs. ........ r88164 | r.david.murray | 2011-01-24 14:34:58 -0500 (Mon, 24 Jan 2011) | 12 lines #10960: fix 'stat' links, link to lstat from stat, general tidy of stat doc. Original patch by Michal Nowikowski, with some additions and wording fixes by me. I changed the wording from 'Performs a stat system call' to 'Performs the equivalent of a stat system call', since on Windows there are no stat/lstat system calls involved. I also extended Michal's breakout of the attributes into a list to the other paragraphs, and rearranged the order of the paragraphs in the 'stat' docs to make it flow better and put it in what I think is a more logical/useful order. ........
This commit is contained in:
parent
730d12f0ca
commit
561b96f98c
12 changed files with 135 additions and 90 deletions
|
|
@ -490,7 +490,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
|||
def tests_and_args():
|
||||
for test in tests:
|
||||
args_tuple = (
|
||||
(test, verbose, quiet, testdir),
|
||||
(test, verbose, quiet),
|
||||
dict(huntrleaks=huntrleaks, use_resources=use_resources)
|
||||
)
|
||||
yield (test, args_tuple)
|
||||
|
|
@ -557,16 +557,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
|||
if trace:
|
||||
# If we're tracing code coverage, then we don't exit with status
|
||||
# if on a false return value from main.
|
||||
tracer.runctx('runtest(test, verbose, quiet, testdir)',
|
||||
tracer.runctx('runtest(test, verbose, quiet)',
|
||||
globals=globals(), locals=vars())
|
||||
else:
|
||||
try:
|
||||
result = runtest(test, verbose, quiet,
|
||||
testdir, huntrleaks)
|
||||
result = runtest(test, verbose, quiet, huntrleaks)
|
||||
accumulate_result(test, result)
|
||||
if verbose3 and result[0] == FAILED:
|
||||
print "Re-running test %r in verbose mode" % test
|
||||
runtest(test, True, quiet, testdir, huntrleaks)
|
||||
runtest(test, True, quiet, huntrleaks)
|
||||
except KeyboardInterrupt:
|
||||
interrupted = True
|
||||
break
|
||||
|
|
@ -636,8 +635,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
|||
sys.stdout.flush()
|
||||
try:
|
||||
test_support.verbose = True
|
||||
ok = runtest(test, True, quiet, testdir,
|
||||
huntrleaks)
|
||||
ok = runtest(test, True, quiet, huntrleaks)
|
||||
except KeyboardInterrupt:
|
||||
# print a newline separate from the ^C
|
||||
print
|
||||
|
|
@ -693,14 +691,13 @@ def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS):
|
|||
return stdtests + sorted(tests)
|
||||
|
||||
def runtest(test, verbose, quiet,
|
||||
testdir=None, huntrleaks=False, use_resources=None):
|
||||
huntrleaks=False, use_resources=None):
|
||||
"""Run a single test.
|
||||
|
||||
test -- the name of the test
|
||||
verbose -- if true, print more messages
|
||||
quiet -- if true, don't print 'skipped' messages (probably redundant)
|
||||
test_times -- a list of (time, test_name) pairs
|
||||
testdir -- test directory
|
||||
huntrleaks -- run multiple times to test for leaks; requires a debug
|
||||
build; a triple corresponding to -R's three arguments
|
||||
Returns one of the test result constants:
|
||||
|
|
@ -716,8 +713,7 @@ def runtest(test, verbose, quiet,
|
|||
if use_resources is not None:
|
||||
test_support.use_resources = use_resources
|
||||
try:
|
||||
return runtest_inner(test, verbose, quiet,
|
||||
testdir, huntrleaks)
|
||||
return runtest_inner(test, verbose, quiet, huntrleaks)
|
||||
finally:
|
||||
cleanup_test_droppings(test, verbose)
|
||||
|
||||
|
|
@ -850,10 +846,8 @@ class saved_test_environment:
|
|||
return False
|
||||
|
||||
|
||||
def runtest_inner(test, verbose, quiet,
|
||||
testdir=None, huntrleaks=False):
|
||||
def runtest_inner(test, verbose, quiet, huntrleaks=False):
|
||||
test_support.unload(test)
|
||||
testdir = findtestdir(testdir)
|
||||
if verbose:
|
||||
capture_stdout = None
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import os.path
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
|
@ -11,6 +12,8 @@ import contextlib
|
|||
import shutil
|
||||
import zipfile
|
||||
|
||||
from test.test_support import strip_python_stderr
|
||||
|
||||
# Executing the interpreter in a subprocess
|
||||
def _assert_python(expected_success, *args, **env_vars):
|
||||
cmd_line = [sys.executable]
|
||||
|
|
@ -31,6 +34,7 @@ def _assert_python(expected_success, *args, **env_vars):
|
|||
p.stdout.close()
|
||||
p.stderr.close()
|
||||
rc = p.returncode
|
||||
err = strip_python_stderr(err)
|
||||
if (rc and expected_success) or (not rc and not expected_success):
|
||||
raise AssertionError(
|
||||
"Process return code is %d, "
|
||||
|
|
|
|||
|
|
@ -4317,7 +4317,7 @@ class TestArgumentError(TestCase):
|
|||
# ArgumentTypeError tests
|
||||
# =======================
|
||||
|
||||
class TestArgumentError(TestCase):
|
||||
class TestArgumentTypeError(TestCase):
|
||||
|
||||
def test_argument_type_error(self):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue