From 3b09d21a9df4303ccffea6b19774ec47c7b9b9f6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Oct 2014 01:48:05 +0200 Subject: Issue #22333: test_threaded_import now displays elapsed time in verbose mode. --- Lib/test/test_threaded_import.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py index 9afaa78..854cdf9 100644 --- a/Lib/test/test_threaded_import.py +++ b/Lib/test/test_threaded_import.py @@ -114,11 +114,15 @@ class ThreadedImportTests(unittest.TestCase): errors = [] done_tasks = [] done.clear() + t0 = time.monotonic() for i in range(N): t = threading.Thread(target=task, args=(N, done, done_tasks, errors,)) t.start() completed = done.wait(10 * 60) + dt = time.monotonic() - t0 + if verbose: + print("%.1f ms" % (dt*1e3), flush=True, end=" ") dbg_info = 'done: %s/%s' % (len(done_tasks), N) self.assertFalse(errors, dbg_info) self.assertTrue(completed, dbg_info) -- cgit v0.12