From: Scott Gasch Date: Tue, 18 Oct 2022 17:16:28 +0000 (-0700) Subject: Adds timer next to progress bar in run_tests.py. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=c13695b2198646d9c37cdf5fc1fff0ac7b192db7;p=pyutils.git Adds timer next to progress bar in run_tests.py. --- diff --git a/tests/run_tests.py b/tests/run_tests.py index 5806c34..3b74ccb 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -121,7 +121,7 @@ class TestResults: out += '\n' if len(self.tests_timed_out) > 0: - out += f' ..{ansi.fg("yellow")}' + out += f' ..{ansi.fg("lightning yellow")}' out += f'{len(self.tests_timed_out)} tests timed out' out += f'{ansi.reset()}:\n' for test in self.tests_failed: @@ -588,13 +588,14 @@ def main() -> Optional[int]: done, started, text=text_utils.BarGraphText.FRACTION, - width=80, + width=72, fgcolor=color, ), - end='\r', + end='', flush=True, ) - time.sleep(0.5) + print(f' {color}{now - start_time:.1f}s{ansi.reset()}', end='\r') + time.sleep(0.1) print(f'{ansi.clear_line()}Final Report:') if config.config['coverage']: