
From: Simon Glass <sjg@chromium.org> If only a single test runs, it does not set the max_count variable, so it remains as zero. Handle this situation as a special case. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index f0101ed6b3d..2baceda51b2 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -579,7 +579,10 @@ def show_timings(): value (int): Value to display, i.e. the relative length of the bar """ if value: - bar_length = int((value / max_count) * max_bar_length) + if max_count: + bar_length = int((value / max_count) * max_bar_length) + else: + bar_length = 1 print(f"{key:>8} : {get_time_delta(msecs):>7} |{'#' * bar_length} {value}", file=buf) # Create the buckets we will use, each has a count and a total time -- 2.43.0