Skip to content

Commit

Permalink
Switch to using unicode table
Browse files Browse the repository at this point in the history
So output displays correctly in less; previously the tables were messing
up all the output. Refer to:
Robpol86/terminaltables#42.
  • Loading branch information
bobwhitelock committed May 27, 2017
1 parent 1e3d2e2 commit 4c3d489
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ pytest-mock==1.6.0
python-Levenshtein==0.12.0
simplegeneric==0.8.1
six==1.10.0
terminaltables==3.1.0
-e git+https://github.com/BobWhitelock/terminaltables.git@2374ae57b8819adc57be5644799fc61cc8e2bf65#egg=terminaltables
traitlets==4.3.2
wcwidth==0.1.7
2 changes: 1 addition & 1 deletion src/doc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def parse_table(element):
row_content = parse_table_row(row)
table_data.append(row_content)

table = terminaltables.SingleTable(table_data).table
table = terminaltables.UnicodeSingleTable(table_data).table
return table


Expand Down
6 changes: 3 additions & 3 deletions src/test_doc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_parsing_nested_elements():


def test_parsing_table(mocker):
mocker.spy(terminaltables, 'SingleTable')
mocker.spy(terminaltables, 'UnicodeSingleTable')

# Wrapper div included to ensure table parsed at any level.
html = (
Expand All @@ -130,12 +130,12 @@ def test_parsing_table(mocker):

# Test table created with correct data (more easily debuggable than
# `parse_test`).
assert terminaltables.SingleTable.call_args_list == [
assert terminaltables.UnicodeSingleTable.call_args_list == [
mock.call(expected_table_data)
]

# Ensure correct table generated.
expected_terminal_table = terminaltables.SingleTable(
expected_terminal_table = terminaltables.UnicodeSingleTable(
expected_table_data
).table
parse_test(html, expected_terminal_table)
Expand Down

0 comments on commit 4c3d489

Please sign in to comment.