From 3f468b1c183f63825e01d860cf950332e2d5ad7a Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 7 Dec 2018 15:14:28 -0800 Subject: [PATCH] Only print_time when not a unit test or debug_level set --- compiler/globals.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index f6a2820b..90a209f5 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -395,11 +395,15 @@ def import_tech(): def print_time(name, now_time, last_time=None, indentation=2): """ Print a statement about the time delta. """ - if last_time: - time = str(round((now_time-last_time).total_seconds(),1)) + " seconds" - else: - time = now_time.strftime('%m/%d/%Y %H:%M:%S') - print("{0} {1}: {2}".format("*"*indentation,name,time)) + global OPTS + + # Don't print during testing + if not OPTS.is_unit_test or OPTS.debug_level>0: + if last_time: + time = str(round((now_time-last_time).total_seconds(),1)) + " seconds" + else: + time = now_time.strftime('%m/%d/%Y %H:%M:%S') + print("{0} {1}: {2}".format("*"*indentation,name,time)) def report_status():