Skip to content

Commit e8e02e3

Browse files
committed
Fix regrtest -F.
1 parent fcd7701 commit e8e02e3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/test/regrtest.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,13 @@ def test_forever(tests=list(selected)):
514514
if bad:
515515
return
516516
tests = test_forever()
517+
test_count = ''
518+
test_count_width = 3
517519
else:
518520
tests = iter(selected)
521+
test_count = '/{}'.format(len(selected))
522+
test_count_width = len(test_count) - 1
519523

520-
tests = list(tests)
521-
test_count = len(tests)
522-
test_count_width = len(str(test_count))
523524
if use_mp:
524525
try:
525526
from threading import Thread
@@ -578,7 +579,7 @@ def work():
578579
finished += 1
579580
continue
580581
if not quiet:
581-
print("[{1:{0}}/{2:{0}}] {3}".format(
582+
print("[{1:{0}}{2}] {3}".format(
582583
test_count_width, test_index, test_count, test))
583584
if stdout:
584585
print(stdout)
@@ -597,7 +598,7 @@ def work():
597598
else:
598599
for test_index, test in enumerate(tests, 1):
599600
if not quiet:
600-
print("[{1:{0}}/{2:{0}}] {3}".format(
601+
print("[{1:{0}}{2}] {3}".format(
601602
test_count_width, test_index, test_count, test))
602603
sys.stdout.flush()
603604
if trace:

0 commit comments

Comments
 (0)