Unverified Commit c02cefb5 authored by Alec's avatar Alec Committed by GitHub
Browse files

fix: reduce pytest-marker-report output noise and move to tests/ (#6359)


Signed-off-by: default avataralec-flowers <aflowers@nvidia.com>
Co-authored-by: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent a55b2433
......@@ -89,7 +89,7 @@ repos:
hooks:
- id: pytest-marker-report
name: Report pytest markers (static + inherited)
entry: python3 scripts/report_pytest_markers.py
entry: python3 tests/report_pytest_markers.py
language: python
pass_filenames: false
additional_dependencies:
......
......@@ -356,6 +356,11 @@ def parse_args():
parser.add_argument(
"--tests", default="tests", help="Path to test directory (default: tests)"
)
parser.add_argument(
"--verbose",
action="store_true",
help="Print all tests with their markers (default: only failures and summary)",
)
return parser.parse_args()
......@@ -395,12 +400,16 @@ def run_collection(test_path: str, use_stubbing: bool) -> tuple[int, Report]:
return exitcode, plugin.build_report()
def print_human_report(report: Report) -> None:
"""Print human-readable report to stdout."""
def print_human_report(report: Report, *, verbose: bool = False) -> None:
"""Print human-readable report to stdout.
By default only prints tests with missing markers and the summary.
Pass verbose=True to print all tests with their markers.
"""
if verbose:
print("\n" + "=" * 80)
print(f"{'TEST ID':<60} | MARKERS")
print("=" * 80)
for rec in report.tests:
print(f"{rec.nodeid:<60} | {', '.join(rec.markers)}")
......@@ -432,7 +441,7 @@ def main() -> int:
declared = load_declared_markers(Path("."))
validate_marker_definitions(report, declared)
print_human_report(report)
print_human_report(report, verbose=args.verbose)
# Strict mode validation
if args.strict:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment