diff --git a/changelog/12667.bugfix.rst b/changelog/12667.bugfix.rst new file mode 100644 index 00000000000..eceee86cb53 --- /dev/null +++ b/changelog/12667.bugfix.rst @@ -0,0 +1 @@ +Fixed a regression where type change in `ExceptionInfo.errisinstance` caused `mypy` to fail. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index e7452825756..8fac39ea298 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -56,7 +56,7 @@ TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] -EXCEPTION_OR_MORE = Union[Type[Exception], Tuple[Type[Exception], ...]] +EXCEPTION_OR_MORE = Union[Type[BaseException], Tuple[Type[BaseException], ...]] class Code: