Skip to content

Commit

Permalink
squash: one extra space
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Nov 2, 2024
1 parent 8a1d26e commit 21f1896
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ def test_create_link_relation(self, mock_config_tree, mock_add_simple_link) -> N


def test_render_command_report_output():
delimiter = (tmt.utils.OUTPUT_WIDTH - 1) * '~'
delimiter = (tmt.utils.OUTPUT_WIDTH - 2) * '~'

assert '\n'.join(tmt.utils.render_command_report(
label='foo',
Expand All @@ -1806,19 +1806,19 @@ def test_render_command_report_output():
# /bar/baz
# stdout (1 lines)
#{delimiter}
# {delimiter}
This is some stdout
#{delimiter}
# {delimiter}
# stderr (1 lines)
#{delimiter}
# {delimiter}
This is some stderr
#{delimiter}
# {delimiter}
"""


def test_render_command_report_exception():
delimiter = (tmt.utils.OUTPUT_WIDTH - 1) * '~'
delimiter = (tmt.utils.OUTPUT_WIDTH - 2) * '~'

assert '\n'.join(tmt.utils.render_command_report(
label='foo',
Expand All @@ -1835,14 +1835,14 @@ def test_render_command_report_exception():
# /bar/baz
# stdout (1 lines)
#{delimiter}
# {delimiter}
This is some stdout
#{delimiter}
# {delimiter}
# stderr (1 lines)
#{delimiter}
# {delimiter}
This is some stderr
#{delimiter}
# {delimiter}
"""


Expand Down
8 changes: 5 additions & 3 deletions tmt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2477,10 +2477,12 @@ def render_run_exception_streams(
line_summary = f"{min(len(content_lines), OUTPUT_LINES)}/{len(content_lines)}"
content_lines = content_lines[-OUTPUT_LINES:]

yield f'{comment_sign} {name} ({line_summary} lines)'
yield comment_sign + (OUTPUT_WIDTH - 1) * '~'
line_intro = f'{comment_sign} '

yield line_intro + f'{name} ({line_summary} lines)'
yield line_intro + (OUTPUT_WIDTH - 2) * '~'
yield from content_lines
yield comment_sign + (OUTPUT_WIDTH - 1) * '~'
yield line_intro + (OUTPUT_WIDTH - 2) * '~'
yield ''


Expand Down

0 comments on commit 21f1896

Please sign in to comment.