From acef7463a07522784695dbab57c77f1584e12e1b Mon Sep 17 00:00:00 2001 From: tassaron Date: Mon, 9 May 2022 22:48:43 -0400 Subject: move variable declaration closer to usage. --- src/command.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/command.py') diff --git a/src/command.py b/src/command.py index 4850051..53801fa 100644 --- a/src/command.py +++ b/src/command.py @@ -261,12 +261,6 @@ class Command(QtCore.QObject): test_report = os.path.join(core.Core.logDir, "test_report.log") tests.run(test_report) - # Print test report into terminal - with open(test_report, "r") as f: - output = f.readlines() - test_output = "".join(output) - print(test_output) - # Choose a numbered location to put the output file logNumber = 0 def getFilename(): @@ -311,6 +305,10 @@ class Command(QtCore.QObject): concatenateLogs("preview_*.log") # Append actual test report to debug log + with open(test_report, "r") as f: + output = f.readlines() + test_output = "".join(output) + print(test_output) with open(filename, "a") as f: f.write(test_output) print(f"Test Report created at {filename}") -- cgit v1.2.3