Skip to content

Commit

Permalink
Better pretty_repr indent
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Nov 11, 2019
1 parent 7075eea commit 6b788fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions exec_helpers/exec_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@ def __pretty_repr__(self, log_wrap: "logwrap.PrettyRepr", indent: int = 0, no_in
"""
next_indent = log_wrap.next_indent(indent)
started = f"{'':<{next_indent}}started={self.started!r},\n" if self.started else ""
stdout = log_wrap.process_element(self.stdout, indent=next_indent, no_indent_start=True)
stderr = log_wrap.process_element(self.stderr, indent=next_indent, no_indent_start=True)
stdout = log_wrap.process_element(self.stdout, indent=log_wrap.next_indent(next_indent), no_indent_start=True)
stderr = log_wrap.process_element(self.stderr, indent=log_wrap.next_indent(next_indent), no_indent_start=True)
msg = (
f"{'':<{0 if no_indent_start else indent}}{self.__class__.__name__}(\n"
f"{'':<{next_indent}}cmd={self.cmd!r},\n"
Expand Down
12 changes: 6 additions & 6 deletions test/test_exec_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ def test_pretty_repr(self):
f"ExecResult(\n"
f" cmd='test',\n"
f" stdout=\n"
f" tuple((\n"
f" b'''{{test: data}}''',\n"
f" )),\n"
f" tuple((\n"
f" b'''{{test: data}}''',\n"
f" )),\n"
f" stderr=\n"
f" tuple((\n"
f" b'''{{test: stderr}}''',\n"
f" )),\n"
f" tuple((\n"
f" b'''{{test: stderr}}''',\n"
f" )),\n"
f" exit_code={result.exit_code!s},\n"
f")",
pretty_repr
Expand Down

0 comments on commit 6b788fe

Please sign in to comment.