Skip to content

Commit 464eef9

Browse files
committed
Keep code in _get_main_color as similar as possible to how it was before
1 parent efdeb51 commit 464eef9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/_pytest/terminal.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,17 @@ def _get_main_color(stats) -> Tuple[str, List[str]]:
10851085
known_types.append(found_type)
10861086
unknown_type_seen = True
10871087

1088+
# main color
10881089
if "failed" in stats or "error" in stats:
1089-
return "red", known_types
1090+
main_color = "red"
10901091
elif "warnings" in stats or unknown_type_seen:
1091-
return "yellow", known_types
1092+
main_color = "yellow"
10921093
elif "passed" in stats:
1093-
return "green", known_types
1094+
main_color = "green"
10941095
else:
1095-
return "yellow", known_types
1096+
main_color = "yellow"
1097+
1098+
return main_color, known_types
10961099

10971100

10981101
def build_summary_stats_line(stats):

0 commit comments

Comments
 (0)