MCPcopy Index your code
hub / github.com/python/cpython / _process_result

Method _process_result

Lib/test/libregrtest/run_workers.py:572–599  ·  view source on GitHub ↗

Returns True if test runner must stop.

(self, item: QueueOutput)

Source from the content-addressed store, hash-verified

570 self.display_progress(self.test_index, text)
571
572 def _process_result(self, item: QueueOutput) -> TestResult:
573 """Returns True if test runner must stop."""
574 if item[0]:
575 # Thread got an exception
576 format_exc = item[1]
577 print_warning(f"regrtest worker thread failed: {format_exc}")
578 result = TestResult("<regrtest worker>", state=State.WORKER_BUG)
579 self.results.accumulate_result(result, self.runtests)
580 return result
581
582 self.test_index += 1
583 mp_result = item[1]
584 result = mp_result.result
585 self.results.accumulate_result(result, self.runtests)
586 self.display_result(mp_result)
587
588 # Display worker stdout
589 if not self.runtests.output_on_failure:
590 show_stdout = True
591 else:
592 # --verbose3 ignores stdout on success
593 show_stdout = (result.state != State.PASSED)
594 if show_stdout:
595 stdout = mp_result.worker_stdout
596 if stdout:
597 print(stdout, flush=True)
598
599 return result
600
601 def run(self) -> None:
602 fail_fast = self.runtests.fail_fast

Callers 1

runMethod · 0.95

Calls 4

display_resultMethod · 0.95
accumulate_resultMethod · 0.80
print_warningFunction · 0.70
TestResultClass · 0.70

Tested by

no test coverage detected