mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
eliminate extra blank line in tabulate
Summary: Eliminate extra blank line in tabulate Reviewed By: kmancini Differential Revision: D22477405 fbshipit-source-id: b867bfa5c971fcac0104563e866a314416f24fb0
This commit is contained in:
parent
2deb2f28eb
commit
aef527dbb0
@ -46,7 +46,9 @@ def tabulate(
|
||||
format_string += "{:<%d}" % col_width
|
||||
|
||||
output = format_string.format(*[label(name) for name in headers])
|
||||
output = output = output.rstrip(" ")
|
||||
for row in rows:
|
||||
output += "\n"
|
||||
output += format_string.format(*[field(row, name) for name in headers])
|
||||
output = output.rstrip(" ")
|
||||
return output
|
||||
|
@ -24,9 +24,9 @@ class TabulateTest(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
output,
|
||||
f"""\
|
||||
A B C {eol}
|
||||
A B C{eol}
|
||||
a_1 b_1 see_1{eol}
|
||||
a_two b_2 c_2 {eol}""",
|
||||
a_two b_2 c_2{eol}""",
|
||||
)
|
||||
|
||||
def test_tabulate_header_labels(self):
|
||||
@ -45,7 +45,7 @@ a_two b_2 c_2 {eol}""",
|
||||
self.assertEqual(
|
||||
output,
|
||||
f"""\
|
||||
Col1 bee C {eol}
|
||||
Col1 bee C{eol}
|
||||
a_1 b_1 see_1{eol}
|
||||
a_two b_2 c_2 {eol}""",
|
||||
a_two b_2 c_2{eol}""",
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user