mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-127718: Add colour to test.regrtest
output (#127719)
This commit is contained in:
parent
2233c303e4
commit
212448b162
7 changed files with 168 additions and 53 deletions
|
@ -6,6 +6,7 @@ import sys
|
|||
import sysconfig
|
||||
import time
|
||||
import trace
|
||||
from _colorize import get_colors # type: ignore[import-not-found]
|
||||
from typing import NoReturn
|
||||
|
||||
from test.support import os_helper, MS_WINDOWS, flush_std_streams
|
||||
|
@ -270,6 +271,9 @@ class Regrtest:
|
|||
return runtests
|
||||
|
||||
def rerun_failed_tests(self, runtests: RunTests) -> None:
|
||||
ansi = get_colors()
|
||||
red, reset = ansi.BOLD_RED, ansi.RESET
|
||||
|
||||
if self.python_cmd:
|
||||
# Temp patch for https://github.com/python/cpython/issues/94052
|
||||
self.log(
|
||||
|
@ -284,7 +288,10 @@ class Regrtest:
|
|||
rerun_runtests = self._rerun_failed_tests(runtests)
|
||||
|
||||
if self.results.bad:
|
||||
print(count(len(self.results.bad), 'test'), "failed again:")
|
||||
print(
|
||||
f"{red}{count(len(self.results.bad), 'test')} "
|
||||
f"failed again:{reset}"
|
||||
)
|
||||
printlist(self.results.bad)
|
||||
|
||||
self.display_result(rerun_runtests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue