Skip to content

Commit

Permalink
Cover skipped result with emoji
Browse files Browse the repository at this point in the history
[Problem]
No skipped option

[Solution]
Skipped option is added
  • Loading branch information
vyahello committed Oct 10, 2021
1 parent 9835a0b commit cf79f73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions plugin/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class _Emoji(Enum):

HOLY: str = "😇"
HELLISH: str = "😡"
SILENT: str = "😶"

def __str__(self) -> str:
"""Returns emoji string value."""
Expand Down Expand Up @@ -80,3 +81,10 @@ def pytest_report_teststatus( # type: ignore
long=f"{_Emoji.HELLISH} Oh crap, it is failed",
)
return failed.outcome, failed.short, failed.long
if report.skipped:
skipped: _TestStatus = _TestStatus(
outcome=report.outcome,
short=str(_Emoji.SILENT),
long=f"{_Emoji.SILENT} Nevermind, it is skipped",
)
return skipped.outcome, skipped.short, skipped.long
6 changes: 5 additions & 1 deletion tests/test_emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ def test_set_long(status: _TestStatus) -> None:


def test_emoji() -> None:
for emoji, icon in {_Emoji.HOLY: '😇', _Emoji.HELLISH: '😡'}.items():
for emoji, icon in {
_Emoji.HOLY: "😇",
_Emoji.HELLISH: "😡",
_Emoji.SILENT: "😶",
}.items():
assert str(emoji) == icon

0 comments on commit cf79f73

Please sign in to comment.