Skip to content

Commit a51037c

Browse files
yamtloganek
authored andcommitted
ConsoleTestReporter: fix "total" in the summary
Fixes: #82
1 parent 697538b commit a51037c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test-runner/wasi_test_runner/reporters/console.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class ConsoleTestReporter(TestReporter):
1111
_PASS_COLOR: str = Fore.GREEN
1212
_FAIL_COLOR: str = Fore.RED
1313
_SKIP_COLOR: str = Fore.LIGHTBLACK_EX
14+
_RESET_COLOR: str = Fore.RESET
1415

1516
def __init__(self, colored: bool = True) -> None:
1617
super().__init__()
@@ -72,7 +73,8 @@ def _get_summary(self, fail_count: int, pass_count: int, skip_count: int) -> str
7273
if skip_count:
7374
items.append(f"{self._skip_color}{skip_count} skipped")
7475

75-
items.append(f"{skip_count} total")
76+
total = fail_count + pass_count + skip_count
77+
items.append(f"{self._reset_color}{total} total")
7678
return ", ".join(items)
7779

7880
def _print_fail(self, text: str) -> None:
@@ -95,3 +97,7 @@ def _pass_color(self) -> str:
9597
@property
9698
def _fail_color(self) -> str:
9799
return self._FAIL_COLOR if self._colored else ""
100+
101+
@property
102+
def _reset_color(self) -> str:
103+
return self._RESET_COLOR if self._colored else ""

0 commit comments

Comments
 (0)