terminal: use "yellow" with any "xpassed" tests

Closes https://github.com/pytest-dev/pytest/issues/449.
This commit is contained in:
Daniel Hahler 2020-01-09 22:19:29 +01:00
parent 9f1ade9acf
commit 13baab746d
3 changed files with 5 additions and 4 deletions

View File

@ -0,0 +1 @@
Use "yellow" main color with any XPASSED tests.

View File

@ -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"

View File

@ -1385,10 +1385,10 @@ def test_terminal_summary_warnings_header_once(testdir):
),
("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,)},
),