diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 257b95cf585..3ee643b187e 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -12,7 +12,13 @@ class OutcomeException(BaseException): """OutcomeException and its subclass instances indicate and contain info - about test and collection outcomes.""" + about test and collection outcomes. + + Inherits from :class:`BaseException` rather than :class:`Exception` so that + broad ``except Exception:`` handlers in user code or tests do not + accidentally swallow pytest outcomes (such as :func:`pytest.skip`, + :func:`pytest.fail`, or :func:`pytest.xfail`) without re-raising them. + """ def __init__(self, msg: str | None = None, pytrace: bool = True) -> None: if msg is not None and not isinstance(msg, str):