Skip to content

Commit 2fb47c6

Browse files
committed
test(benchmark): properly aligned table columns
1 parent 7cd57dc commit 2fb47c6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎lab/benchmark.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,9 @@ def show_results(
412412
data_order = [*rows, column]
413413
remap = [data_order.index(datum) for datum in ["proj", "pyver", "cov"]]
414414

415+
WIDTH = 20
415416
def as_table_row(vals):
416-
return "| " + " | ".join(vals) + " |"
417+
return "| " + " | ".join(v.ljust(WIDTH) for v in vals) + " |"
417418

418419
header = []
419420
header.extend(rows)
@@ -422,7 +423,8 @@ def as_table_row(vals):
422423

423424
print()
424425
print(as_table_row(header))
425-
print("|----" * len(header) + "|")
426+
dashes = [":---"] * len(rows) + ["---:"] * (len(header) - len(rows))
427+
print(as_table_row(dashes))
426428
for tup in itertools.product(*table_axes):
427429
row = []
428430
row.extend(tup)

0 commit comments

Comments
 (0)