diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 30ab01235..7d72234e7 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -520,7 +520,9 @@ class ExceptionInfo(Generic[_E]): text = text[len(self._striptext) :] return text - def errisinstance(self, exc: "Type[BaseException]") -> bool: + def errisinstance( + self, exc: Union["Type[BaseException]", Tuple["Type[BaseException]", ...]] + ) -> bool: """ return True if the exception is an instance of exc """ return isinstance(self.value, exc)