in tests.py [0:0]
def _render_table(self, cells: list[list[Any]]) -> str:
# Could just use pandas here, but choosing to avoid unnecessary deps
# Convert all elements to strings
str_data: list[list[str]] = [[str(item) for item in row] for row in cells]
# Find the maximum width for each column
num_cols: int = len(str_data[0])
col_widths: list[int] = [
max(len(row[i]) for row in str_data) for i in range(num_cols)
]
result: str = ""
# Pad each element in each column
for row in str_data:
for i, cell in enumerate(row):
result += cell.ljust(col_widths[i]) + (" " * 5)
result += "\n"
return result