summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-09-30 23:48:05 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-09-30 23:48:05 (GMT)
commit3b09d21a9df4303ccffea6b19774ec47c7b9b9f6 (patch)
treefc45aa64d08b72424dd59d0b98560ffe645f835e /Lib
parentd7722d7147386a3bfac0a8b7e94ef0cbf5030b6f (diff)
downloadcpython-3b09d21a9df4303ccffea6b19774ec47c7b9b9f6.zip
cpython-3b09d21a9df4303ccffea6b19774ec47c7b9b9f6.tar.gz
cpython-3b09d21a9df4303ccffea6b19774ec47c7b9b9f6.tar.bz2
Issue #22333: test_threaded_import now displays elapsed time in verbose mode.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_threaded_import.py4
1 files changed, 4 insertions, 0 deletions
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)