Output: maxcolwidth can be specified as a single number that works for each column
()
| 157 | |
| 158 | |
| 159 | def test_maxcolwidth_single_value(): |
| 160 | "Output: maxcolwidth can be specified as a single number that works for each column" |
| 161 | table = [ |
| 162 | ["hdr", "fold1", "fold2"], |
| 163 | ["mini", "this is short", "this is a bit longer"], |
| 164 | ] |
| 165 | expected = "\n".join( |
| 166 | [ |
| 167 | "hdr fold1 fold2", |
| 168 | "mini this this", |
| 169 | " is is a", |
| 170 | " short bit", |
| 171 | " longer", |
| 172 | ] |
| 173 | ) |
| 174 | result = tabulate(table, headers="firstrow", tablefmt="plain", maxcolwidths=6) |
| 175 | assert_equal(expected, result) |
| 176 | |
| 177 | |
| 178 | def test_maxcolwidth_pad_tailing_widths(): |
nothing calls this directly
no test coverage detected