From 4e234ae135baea2667deace02afcf026a98790bc Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Thu, 11 Jun 2026 12:16:41 +0200 Subject: [PATCH] fix(walltime): normalize minimum time only once In the local walltime mode results table, the "Time (best)" column divides by `iter_per_round` twice: once in `BenchmarkStats.from_list`, and again in `_print_benchmark_table`. This is only an issue for fast benchmarks: since `iter_per_round` defaults to 1ms, the time for benchmarks taking more than 1ms get divided by 1 twice. Signed-off-by: Luka Peschke --- src/pytest_codspeed/instruments/walltime.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_codspeed/instruments/walltime.py b/src/pytest_codspeed/instruments/walltime.py index c9d341c..0f65547 100644 --- a/src/pytest_codspeed/instruments/walltime.py +++ b/src/pytest_codspeed/instruments/walltime.py @@ -380,7 +380,7 @@ def _print_benchmark_table(self) -> None: rsd_text.stylize("red bold") table.add_row( escape(bench.name), - format_time(bench.stats.min_ns / bench.stats.iter_per_round), + format_time(bench.stats.min_ns), rsd_text, f"{bench.stats.total_time:,.2f}s", f"{bench.stats.iter_per_round * bench.stats.rounds:,}",