fix(run_tests_batched): colorize non-xdist format (tests/... STATUS), filter 'Error during log pruning' noise
This commit is contained in:
@@ -89,11 +89,13 @@ _NOISE_PREFIXES: tuple[str, ...] = (
|
|||||||
"[LogPruner]",
|
"[LogPruner]",
|
||||||
"[startup]",
|
"[startup]",
|
||||||
"created: ",
|
"created: ",
|
||||||
|
"Error during log pruning",
|
||||||
"=========",
|
"=========",
|
||||||
)
|
)
|
||||||
|
|
||||||
_NOISE_SUBSTRINGS: tuple[str, ...] = (
|
_NOISE_SUBSTRINGS: tuple[str, ...] = (
|
||||||
"[WinError",
|
"[WinError",
|
||||||
|
"File must be opened in binary mode",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _format_pytest_line(line: str) -> str | None:
|
def _format_pytest_line(line: str) -> str | None:
|
||||||
@@ -114,6 +116,13 @@ def _format_pytest_line(line: str) -> str | None:
|
|||||||
return _c(stripped, _C.BOLD_RED)
|
return _c(stripped, _C.BOLD_RED)
|
||||||
if " ERROR " in stripped and "[gw" in stripped:
|
if " ERROR " in stripped and "[gw" in stripped:
|
||||||
return _c(stripped, _C.BOLD_RED)
|
return _c(stripped, _C.BOLD_RED)
|
||||||
|
if stripped.startswith(("tests/", "tests\\")) and "::" in stripped:
|
||||||
|
if " PASSED" in stripped:
|
||||||
|
return _c(stripped, _C.GREEN)
|
||||||
|
if " FAILED" in stripped:
|
||||||
|
return _c(stripped, _C.BOLD_RED)
|
||||||
|
if " ERROR" in stripped:
|
||||||
|
return _c(stripped, _C.BOLD_RED)
|
||||||
if stripped.startswith(("PASSED", "FAILED", "ERROR")) and "::" in stripped:
|
if stripped.startswith(("PASSED", "FAILED", "ERROR")) and "::" in stripped:
|
||||||
status = stripped.split()[0]
|
status = stripped.split()[0]
|
||||||
rest = stripped[len(status):]
|
rest = stripped[len(status):]
|
||||||
|
|||||||
Reference in New Issue
Block a user