Skip to content

Commit

Permalink
Add test cases with 1 and 3 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
syxolk committed Nov 7, 2017
1 parent 7a71573 commit 23fc5d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/io/formats/test_to_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,14 @@ def test_to_latex_longtable(self, frame):

assert withoutindex_result == withoutindex_expected

df = DataFrame({'a': [1, 2]})
with1column_result = df.to_latex(index=False, longtable=True)
assert "\multicolumn{1}" in with1column_result

df = DataFrame({'a': [1, 2], 'b': [3, 4], 'c': [5, 6]})
with3columns_result = df.to_latex(index=False, longtable=True)
assert "\multicolumn{3}" in with3columns_result

def test_to_latex_escape_special_chars(self):
special_characters = ['&', '%', '$', '#', '_', '{', '}', '~', '^',
'\\']
Expand Down

0 comments on commit 23fc5d3

Please sign in to comment.