MCPcopy
hub / github.com/pytest-dev/pytest / listoutcomes

Method listoutcomes

src/_pytest/pytester.py:417–439  ·  view source on GitHub ↗
(
        self,
    )

Source from the content-addressed store, hash-verified

415 return self.getfailures("pytest_collectreport")
416
417 def listoutcomes(
418 self,
419 ) -> tuple[
420 Sequence[TestReport],
421 Sequence[CollectReport | TestReport],
422 Sequence[CollectReport | TestReport],
423 ]:
424 passed = []
425 skipped = []
426 failed = []
427 for rep in self.getreports(
428 ("pytest_collectreport", "pytest_runtest_logreport")
429 ):
430 if rep.passed:
431 if rep.when == "call":
432 assert isinstance(rep, TestReport)
433 passed.append(rep)
434 elif rep.skipped:
435 skipped.append(rep)
436 else:
437 assert rep.failed, f"Unexpected outcome: {rep!r}"
438 failed.append(rep)
439 return passed, skipped, failed
440
441 def countoutcomes(self) -> list[int]:
442 return [len(x) for x in self.listoutcomes()]

Callers 15

countoutcomesMethod · 0.95
assertoutcomeMethod · 0.95
test_make_hook_recorderFunction · 0.80
test_xfail_itemFunction · 0.80
test_mark_xfail_itemFunction · 0.80
test_raises_outputMethod · 0.80
test_broken_reprMethod · 0.80
test_mark_optionFunction · 0.80
test_mark_option_customFunction · 0.80

Calls 2

getreportsMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected