From db34a3a7017d0096faa8d3f020efd078ad8a65e1 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 16 Jul 2017 14:06:26 +0300 Subject: Close files reliably. --- run_project_tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'run_project_tests.py') diff --git a/run_project_tests.py b/run_project_tests.py index 5994c5a3b..3420946c3 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -463,10 +463,15 @@ def detect_tests_to_run(): return gathered_tests def run_tests(all_tests, log_name_base, extra_args): - global stop, executor, futures + global logfile txtname = log_name_base + '.txt' + with open(txtname, 'w', encoding="utf_8") as lf: + logfile = lf + return _run_tests(all_tests, log_name_base, extra_args) + +def _run_tests(all_tests, log_name_base, extra_args): + global stop, executor, futures xmlname = log_name_base + '.xml' - logfile = open(txtname, 'w', encoding="utf_8") junit_root = ET.Element('testsuites') conf_time = 0 build_time = 0 -- cgit v1.2.3