Merge pull request #7020 from blueyed/fix-warnings-summary
Fix warnings summary
This commit is contained in:
@@ -846,7 +846,7 @@ class TerminalReporter:
|
||||
|
||||
def collapsed_location_report(reports: List[WarningReport]):
|
||||
locations = []
|
||||
for w in warning_reports:
|
||||
for w in reports:
|
||||
location = w.get_location(self.config)
|
||||
if location:
|
||||
locations.append(location)
|
||||
@@ -858,16 +858,14 @@ class TerminalReporter:
|
||||
str(loc).split("::", 1)[0] for loc in locations
|
||||
)
|
||||
return "\n".join(
|
||||
"{0}: {1} test{2} with warning{2}".format(
|
||||
k, v, "s" if v > 1 else ""
|
||||
)
|
||||
"{}: {} warning{}".format(k, v, "s" if v > 1 else "")
|
||||
for k, v in counts_by_filename.items()
|
||||
)
|
||||
|
||||
title = "warnings summary (final)" if final else "warnings summary"
|
||||
self.write_sep("=", title, yellow=True, bold=False)
|
||||
for message, warning_reports in reports_grouped_by_message.items():
|
||||
maybe_location = collapsed_location_report(warning_reports)
|
||||
for message, message_reports in reports_grouped_by_message.items():
|
||||
maybe_location = collapsed_location_report(message_reports)
|
||||
if maybe_location:
|
||||
self._tw.line(maybe_location)
|
||||
lines = message.splitlines()
|
||||
|
||||
Reference in New Issue
Block a user