Skip to content

Commit

Permalink
regrtest: fix --list-cases --verbose (#2547)
Browse files Browse the repository at this point in the history
Write header and "Using seed ..." after checking for --list-cases and
--list-tests.
  • Loading branch information
vstinner committed Jul 3, 2017
1 parent c51a8e9 commit 1e4fcb3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions Lib/test/regrtest.py
Expand Up @@ -533,17 +533,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
nottests.add(arg)
args = []

# 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()
print "Testing with flags:", sys.flags

alltests = findtests(testdir, stdtests, nottests)
selected = tests or args or alltests
if single:
Expand All @@ -552,10 +541,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
next_single_test = alltests[alltests.index(selected[0])+1]
except IndexError:
next_single_test = None
if randomize:
random.seed(random_seed)
print "Using random seed", random_seed
random.shuffle(selected)

if list_tests:
for name in selected:
Expand Down Expand Up @@ -623,6 +608,22 @@ def display_progress(test_index, test):
print(line)
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()
print "Testing with flags:", sys.flags

if randomize:
random.seed(random_seed)
print "Using random seed", random_seed
random.shuffle(selected)

if use_mp:
try:
from threading import Thread
Expand Down

0 comments on commit 1e4fcb3

Please sign in to comment.