Skip to content

Commit

Permalink
terminal: use "yellow" with any "xpassed" tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jan 9, 2020
1 parent 9f1ade9 commit 13baab7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/449.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use "yellow" main color with any XPASSED tests.
2 changes: 1 addition & 1 deletion src/_pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ def _get_main_color(stats) -> Tuple[str, List[str]]:
# main color
if "failed" in stats or "error" in stats:
main_color = "red"
elif "warnings" in stats or unknown_type_seen:
elif "warnings" in stats or "xpassed" in stats or unknown_type_seen:
main_color = "yellow"
elif "passed" in stats:
main_color = "green"
Expand Down
6 changes: 3 additions & 3 deletions testing/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,10 +1385,10 @@ def test_failure():
),
("yellow", [("1 xpassed", {"bold": True, "yellow": True})], {"xpassed": (1,)}),
(
"green",
"yellow",
[
("1 passed", {"bold": True, "green": True}),
("1 xpassed", {"bold": False, "yellow": True}),
("1 passed", {"bold": False, "green": True}),
("1 xpassed", {"bold": True, "yellow": True}),
],
{"xpassed": (1,), "passed": (1,)},
),
Expand Down

0 comments on commit 13baab7

Please sign in to comment.