1313from test .libregrtest .runtest import (
1414 findtests , runtest ,
1515 STDTESTS , NOTTESTS , PASSED , FAILED , ENV_CHANGED , SKIPPED , RESOURCE_DENIED ,
16- INTERRUPTED , CHILD_ERROR )
16+ INTERRUPTED , CHILD_ERROR ,
17+ PROGRESS_MIN_TIME )
1718from test .libregrtest .setup import setup_tests
1819from test import support
1920try :
@@ -293,8 +294,15 @@ def run_tests_sequential(self):
293294
294295 save_modules = sys .modules .keys ()
295296
297+ previous_test = None
296298 for test_index , test in enumerate (self .tests , 1 ):
297- self .display_progress (test_index , test )
299+ start_time = time .monotonic ()
300+
301+ text = test
302+ if previous_test :
303+ text = '%s -- %s' % (text , previous_test )
304+ self .display_progress (test_index , text )
305+
298306 if self .tracer :
299307 # If we're tracing code coverage, then we don't exit with status
300308 # if on a false return value from main.
@@ -311,6 +319,12 @@ def run_tests_sequential(self):
311319 else :
312320 self .accumulate_result (test , result )
313321
322+ test_time = time .monotonic () - start_time
323+ if test_time >= PROGRESS_MIN_TIME :
324+ previous_test = '%s took %.0f sec' % (test , test_time )
325+ else :
326+ previous_test = None
327+
314328 if self .ns .findleaks :
315329 gc .collect ()
316330 if gc .garbage :
@@ -326,6 +340,9 @@ def run_tests_sequential(self):
326340 if module not in save_modules and module .startswith ("test." ):
327341 support .unload (module )
328342
343+ if previous_test :
344+ print (previous_test )
345+
329346 def _test_forever (self , tests ):
330347 while True :
331348 for test in tests :
0 commit comments