Skip to content

[2.7] regrtest: fix test to choose if header should be displayed #3172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Lib/test/regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -657,18 +658,17 @@ def display_progress(test_index, test):
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)
Expand Down