From 669ac25d0db3888f2c41e3f50344d728be29a701 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Sun, 19 Nov 2017 20:54:33 -0800 Subject: [PATCH] Ensure log file is fully written before reading it Fixes --print-failures sometimes not actually printing out details about failures. --- debug/testlib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/debug/testlib.py b/debug/testlib.py index 90702bf..5fc384a 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -606,6 +606,7 @@ def run_tests(parsed, target, todo): finally: sys.stdout = real_stdout log_fd.write("Time elapsed: %.2fs\n" % (time.time() - start)) + log_fd.flush() print "[%s] %s in %.2fs" % (name, result, time.time() - start) if result not in good_results and parsed.print_failures: sys.stdout.write(open(log_name).read()) -- 2.30.2