diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-08-21 21:57:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-21 21:57:06 (GMT) |
commit | 0fbac706f7c798fdeda63e39009c2285dad2c33f (patch) | |
tree | f42ebb9d626a95296da949c077107468358df1a4 | |
parent | 02d4292df4bbd7a2cbf2716c9e6c22cae76e2093 (diff) | |
download | cpython-0fbac706f7c798fdeda63e39009c2285dad2c33f.zip cpython-0fbac706f7c798fdeda63e39009c2285dad2c33f.tar.gz cpython-0fbac706f7c798fdeda63e39009c2285dad2c33f.tar.bz2 |
regrtest: fix test to choose if header should be displayed (#3172)
Check "tests" before its value is replaced.
-rwxr-xr-x | Lib/test/regrtest.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index cd8cc15..83434c8 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -572,6 +572,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, nottests.add(arg) args = [] + display_header = (verbose or header or not (quiet or single or tests or args)) and (not pgo) alltests = findtests(testdir, stdtests, nottests) selected = tests or args or alltests if single: @@ -657,18 +658,17 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, sys.stdout.flush() # For a partial run, we do not need to clutter the output. - if verbose or header or not (quiet or single or tests or args): - if not pgo: - # Print basic platform information - print "==", platform.python_implementation(), \ - " ".join(sys.version.split()) - print "== ", platform.platform(aliased=True), \ - "%s-endian" % sys.byteorder - print "== ", os.getcwd() - ncpu = cpu_count() - if ncpu: - print "== CPU count:", ncpu - print "Testing with flags:", sys.flags + if display_header: + # Print basic platform information + print "==", platform.python_implementation(), \ + " ".join(sys.version.split()) + print "== ", platform.platform(aliased=True), \ + "%s-endian" % sys.byteorder + print "== ", os.getcwd() + ncpu = cpu_count() + if ncpu: + print "== CPU count:", ncpu + print "Testing with flags:", sys.flags if randomize: random.seed(random_seed) |