Skip to content

Commit 1b3e1f6

Browse files
group errors on same line
1 parent cd6d470 commit 1b3e1f6

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ def _try_parse_multi_error_string_message(workspace, filesystempath, longrepr):
104104
if not all(matches):
105105
return None
106106

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

109119

110120
def _error_workflow_command(filesystempath, lineno, longrepr):

0 commit comments

Comments
 (0)