Formats `output`, either on one line, or indented across multiple lines.
(output, indent=4)
| 45 | |
| 46 | |
| 47 | def _format_output(output, indent=4): |
| 48 | """Formats `output`, either on one line, or indented across multiple lines.""" |
| 49 | formatted = pprint.pformat(output) |
| 50 | lines = formatted.splitlines() |
| 51 | if len(lines) == 1: |
| 52 | return formatted |
| 53 | lines = [" " * indent + line for line in lines] |
| 54 | return "\n" + "\n".join(lines) |
| 55 | |
| 56 | |
| 57 | Action = Callable[[runner.Output], None] |
no test coverage detected