diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-03 20:38:52 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-03 20:38:52 (GMT) |
commit | 3c4402f879ccc6c0fbd9e95e2a473b67ccd43ba9 (patch) | |
tree | 771460906d3fd61c0b5a5187321608de7d31bc1e /Lib/test/regrtest.py | |
parent | 751ba4cfac806a064496baf929d44aa5e6591c20 (diff) | |
download | cpython-3c4402f879ccc6c0fbd9e95e2a473b67ccd43ba9.zip cpython-3c4402f879ccc6c0fbd9e95e2a473b67ccd43ba9.tar.gz cpython-3c4402f879ccc6c0fbd9e95e2a473b67ccd43ba9.tar.bz2 |
Issue #6293: Have regrtest.py echo back sys.flags. This is done by default
in whole runs and enabled selectively using `--header` when running an
explicit list of tests. Original patch by Collin Winter.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index c40f7f9..594c58f 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -29,6 +29,7 @@ Verbosity -d/--debug -- print traceback for failed tests -q/--quiet -- no output unless one or more tests fail -S/--slow -- print the slowest 10 tests + --header -- print header with interpreter info Selecting tests @@ -228,7 +229,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, - random_seed=None, use_mp=None, verbose3=False, forever=False): + random_seed=None, use_mp=None, verbose3=False, forever=False, + header=False): """Execute a test suite. This also parses command-line options and modifies its behavior @@ -262,7 +264,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=', 'multiprocess=', 'slaveargs=', 'forever', 'debug', 'start=', - 'nowindows']) + 'nowindows', 'header']) except getopt.error as msg: usage(msg) @@ -371,6 +373,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, forever = True elif o in ('-j', '--multiprocess'): use_mp = int(a) + elif o == '--header': + header = True elif o == '--slaveargs': args, kwargs = json.loads(a) try: @@ -447,12 +451,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, args = [] # For a partial run, we do not need to clutter the output. - if verbose or not (quiet or single or tests or args): + if verbose or header or not (quiet or single or tests or args): # Print basic platform information print("==", platform.python_implementation(), *sys.version.split()) print("== ", platform.platform(aliased=True), "%s-endian" % sys.byteorder) print("== ", os.getcwd()) + print("Testing with flags:", sys.flags) alltests = findtests(testdir, stdtests, nottests) selected = tests or args or alltests |