Skip to content

Commit 520ed0e

Browse files
authored
Merge pull request #306 from oddbookworm/master
Fix a `KeyError` when tabulating empty data with the `colalign` param populated
2 parents 7d8e8b3 + 0944a22 commit 520ed0e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/test_regression.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,3 +512,14 @@ def test_numpy_int64_as_integer():
512512
assert_equal(expected, result)
513513
except ImportError:
514514
raise skip("")
515+
516+
def test_empty_table_with_colalign():
517+
"Regression: empty table with colalign kwarg"
518+
table = tabulate([], ["a", "b", "c"], colalign=("center", "left", "left", "center"))
519+
expected = "\n".join(
520+
[
521+
"a b c",
522+
"--- --- ---",
523+
]
524+
)
525+
assert_equal(expected, table)

0 commit comments

Comments
 (0)