Skip to content

Commit 79cceea

Browse files
helpmefindanamehenryiii
authored andcommitted
group errors on same line
1 parent 0c202c4 commit 79cceea

File tree

1 file changed

+11
-1
lines changed
  • pytest_github_actions_annotate_failures

1 file changed

+11
-1
lines changed

pytest_github_actions_annotate_failures/plugin.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,17 @@ def _try_parse_multi_error_string_message(workspace, filesystempath, longrepr):
102102
if not all(matches):
103103
return None
104104

105-
return [(int(match.group(1)), match.group(2)) for match in matches]
105+
errors_per_line = {}
106+
107+
for match in matches:
108+
line_no = int(match.group(1))
109+
message = match.group(2)
110+
if line_no not in errors_per_line:
111+
errors_per_line[line_no] = message
112+
else:
113+
errors_per_line[line_no] += "\n" + message
114+
115+
return errors_per_line.items()
106116

107117

108118
def _error_workflow_command(filesystempath, lineno, longrepr):

0 commit comments

Comments
 (0)