MCPcopy Create free account
hub / github.com/pytest-dev/pytest / errisinstance

Method errisinstance

src/_pytest/_code/code.py:593–600  ·  view source on GitHub ↗

Return True if the exception is an instance of exc. Consider using ``isinstance(excinfo.value, exc)`` instead.

(
        self, exc: Union[Type[BaseException], Tuple[Type[BaseException], ...]]
    )

Source from the content-addressed store, hash-verified

591 return text
592
593 def errisinstance(
594 self, exc: Union[Type[BaseException], Tuple[Type[BaseException], ...]]
595 ) -> bool:
596 """Return True if the exception is an instance of exc.
597
598 Consider using ``isinstance(excinfo.value, exc)`` instead.
599 """
600 return isinstance(self.value, exc)
601
602 def _getreprcrash(self) -> "ReprFileLocation":
603 exconly = self.exconly(tryshort=True)

Callers 2

test_pytest_exitFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_pytest_exitFunction · 0.64