diff --git a/_pytest/python.py b/_pytest/python.py index 254459d9500..526f4be09cb 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1337,6 +1337,8 @@ def raises(expected_exception, *args, **kwargs): >>> with raises(ZeroDivisionError): ... 1/0 + .. versionchanged:: 2.10 + In the context manager form you may use the keyword argument ``message`` to specify a custom failure message:: diff --git a/doc/en/assert.rst b/doc/en/assert.rst index 687dadb8528..d867dfa9af6 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -85,6 +85,8 @@ and if you need to have access to the actual exception info you may use:: the actual exception raised. The main attributes of interest are ``.type``, ``.value`` and ``.traceback``. +.. versionchanged:: 2.10 + In the context manager form you may use the keyword argument ``message`` to specify a custom failure message::