Make test runner quiet with failure-only ticker

This commit is contained in:
silveroxides
2026-10-02 02:02:03 +02:00
parent 2974f394c7
commit 513d4c60a1
2 changed files with 31 additions and 7 deletions
+8
View File
@@ -0,0 +1,8 @@
def pytest_report_teststatus(report, config):
"""Pytest hook: emit only 'F' for failed tests and nothing for passing/skipped tests."""
if report.when in ("setup", "call") and report.failed:
return "failed", "F", "FAILED"
if report.passed:
return "passed", "", ""
if report.skipped:
return "skipped", "", ""
+23 -7
View File
@@ -172,11 +172,25 @@ def run_selection(selection: Selection) -> int:
filter(None, (str(REPOSITORY_ROOT), environment.get("PYTHONPATH", "")))
)
result = subprocess.run(
[sys.executable, "-m", "pytest", "-q", "--import-mode=importlib",
"--basetemp", str(basetemp),
*[str((REPOSITORY_ROOT / path).resolve())
for path in sorted(selection.python_tests)]],
cwd=COMFYUI_ROOT, env=environment, check=False,
[
sys.executable,
"-m",
"pytest",
"-q",
"--import-mode=importlib",
"-o",
"addopts=",
"--capture=sys",
"--basetemp",
str(basetemp),
*[
str((REPOSITORY_ROOT / path).resolve())
for path in sorted(selection.python_tests)
],
],
cwd=COMFYUI_ROOT,
env=environment,
check=False,
)
return result.returncode
finally:
@@ -222,11 +236,13 @@ def main(argv: list[str] | None = None) -> int:
print(f" {path}", file=sys.stderr)
print("Update tests/test_groups.toml or use --final.", file=sys.stderr)
return 2
print_selection(selection)
if args.dry_run:
print_selection(selection)
return 0
if not selection.python_tests:
print("No tests selected.")
return 0
return 0 if args.dry_run else run_selection(selection)
return run_selection(selection)
if __name__ == "__main__":