Skip to content

Commit 1d8da26

Browse files
author
Cody D'Ambrosio
committed
fix newlines
1 parent a8aac34 commit 1d8da26

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/pytest_tap/plugin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ def _make_as_raw_yaml_block(report):
216216
lines = report.longrepr.reprcrash.message.splitlines(keepends=True)
217217
except AttributeError:
218218
lines = report.longreprtext.splitlines(keepends=True)
219-
user_properties = getattr(report, "user_properties", [])
220-
return f"""{"\n".join(f"{k}: {v}" for k, v in user_properties)}\
219+
res = f"""\
221220
message: |
222221
{"".join(f" {line}" for line in lines)}
223222
severity: {report.outcome}
224-
duration_ms: {report.duration * 1000}
225-
"""
223+
duration_ms: {report.duration * 1000}"""
224+
if hasattr(report, "user_properties"):
225+
res += "\n" + "\n".join(f'{k}: {v}' for k, v in report.user_properties)
226+
return res

0 commit comments

Comments
 (0)