Detailed human-readable format.
(self, report: TestSuiteReport)
| 335 | return f"Tests: {status} ({report.passed}/{report.total_tests}) in {report.total_duration:.2f}s" |
| 336 | |
| 337 | def format_detailed_report(self, report: TestSuiteReport) -> str: |
| 338 | """Detailed human-readable format.""" |
| 339 | lines = [ |
| 340 | "=" * 60, |
| 341 | "PyFlowGraph Test Execution Report", |
| 342 | "=" * 60, |
| 343 | "", |
| 344 | f"Execution Summary:", |
| 345 | f" Total Tests: {report.total_tests}", |
| 346 | f" Passed: {report.passed}", |
| 347 | f" Failed: {report.failed}", |
| 348 | f" Skipped: {report.skipped}", |
| 349 | f" Errors: {report.errors}", |
| 350 | f" Duration: {report.total_duration:.2f} seconds", |
| 351 | f" Workers: {report.parallel_workers}", |
| 352 | "" |
| 353 | ] |
| 354 | |
| 355 | # Performance analysis |
| 356 | perf = report.performance_summary |
| 357 | lines.extend([ |
| 358 | "Performance Analysis:", |
| 359 | f" Average test time: {perf.get('average_time', 0):.3f}s", |
| 360 | f" Slowest test: {perf.get('max_time', 0):.3f}s", |
| 361 | f" Slow tests (>5s): {perf.get('slow_tests_count', 0)}", |
| 362 | "" |
| 363 | ]) |
| 364 | |
| 365 | # Failed tests |
| 366 | failed_tests = [r for r in report.results if r.status == "FAIL"] |
| 367 | if failed_tests: |
| 368 | lines.append("Failed Tests:") |
| 369 | for test in failed_tests: |
| 370 | lines.append(f" FAIL: {test.name} ({test.duration:.3f}s)") |
| 371 | if test.error_message: |
| 372 | error_lines = test.error_message.split('\n')[:3] # First 3 lines |
| 373 | for error_line in error_lines: |
| 374 | lines.append(f" {error_line}") |
| 375 | lines.append("") |
| 376 | |
| 377 | return '\n'.join(lines) |
| 378 | |
| 379 | def main(): |
| 380 | """Main entry point for the test runner.""" |