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

Method assert_outcomes

src/_pytest/pytester.py:593–624  ·  src/_pytest/pytester.py::RunResult.assert_outcomes

Assert that the specified outcomes appear with the respective numbers (0 means it didn't occur) in the text output from a test run. ``warnings`` and ``deselected`` are only checked if not None.

(
        self,
        passed: int = 0,
        skipped: int = 0,
        failed: int = 0,
        errors: int = 0,
        xpassed: int = 0,
        xfailed: int = 0,
        warnings: int | None = None,
        deselected: int | None = None,
    )

Source from the content-addressed store, hash-verified

591 return {to_plural.get(k, k): v for k, v in ret.items()}
592
593 def assert_outcomes(
594 self,
595 passed: int = 0,
596 skipped: int = 0,
597 failed: int = 0,
598 errors: int = 0,
599 xpassed: int = 0,
600 xfailed: int = 0,
601 warnings: int | None = None,
602 deselected: int | None = None,
603 ) -> None:
604 class="st">"""
605 Assert that the specified outcomes appear with the respective
606 numbers (0 means it didn&class="cm">#x27;t occur) in the text output from a test run.
607
608 ``warnings`` and ``deselected`` are only checked if not None.
609 class="st">"""
610 __tracebackhide__ = True
611 from _pytest.pytester_assertions import assert_outcomes
612
613 outcomes = self.parseoutcomes()
614 assert_outcomes(
615 outcomes,
616 passed=passed,
617 skipped=skipped,
618 failed=failed,
619 errors=errors,
620 xpassed=xpassed,
621 xfailed=xfailed,
622 warnings=warnings,
623 deselected=deselected,
624 )
625
626
627class SysModulesSnapshot:

Calls 2

parseoutcomesMethod · 0.95
assert_outcomesFunction · 0.90

Tested by

no test coverage detected