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

Method _check_check

src/_pytest/raises.py:463–475  ·  view source on GitHub ↗
(
        self: AbstractRaises[BaseExcT_1],
        exception: BaseExcT_1,
    )

Source from the content-addressed store, hash-verified

461 return self._fail_reason
462
463 def _check_check(
464 self: AbstractRaises[BaseExcT_1],
465 exception: BaseExcT_1,
466 ) -> bool:
467 if self.check is None:
468 return True
469
470 if self.check(exception):
471 return True
472
473 check_repr = "" if self._nested else " " + repr_callable(self.check)
474 self._fail_reason = f"check{check_repr} did not return True"
475 return False
476
477 # TODO: harmonize with ExceptionInfo.match
478 def _check_match(self, e: BaseException) -> bool:

Callers 2

matchesMethod · 0.80
matchesMethod · 0.80

Calls 2

repr_callableFunction · 0.85
checkMethod · 0.45

Tested by

no test coverage detected