Determine if a result should be displayed
(self, result: TestResult)
| 335 | ts_print(f" {msg}") |
| 336 | |
| 337 | def _should_display(self, result: TestResult) -> bool: |
| 338 | """Determine if a result should be displayed""" |
| 339 | # Always show errors |
| 340 | if result.type == TestResultType.ERROR: |
| 341 | return True |
| 342 | |
| 343 | # Always show final success/completion messages |
| 344 | if any( |
| 345 | marker in result.message |
| 346 | for marker in ["### SUCCESS", "### ERROR", "Test execution complete:"] |
| 347 | ): |
| 348 | return True |
| 349 | |
| 350 | # Show warnings in verbose mode |
| 351 | if result.type == TestResultType.WARNING and self.verbose: |
| 352 | return True |
| 353 | |
| 354 | # Show info/debug only in verbose mode |
| 355 | return self.verbose and result.type in [ |
| 356 | TestResultType.INFO, |
| 357 | TestResultType.DEBUG, |
| 358 | ] |
| 359 | |
| 360 | |
| 361 | @typechecked |