Skip to content

Commit e5b527d

Browse files
committed
Add Sphinx parameter docs for match and message args to pytest.raises()
1 parent c04e248 commit e5b527d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

_pytest/python_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ def raises(expected_exception, *args, **kwargs):
453453
Assert that a code block/function call raises ``expected_exception``
454454
and raise a failure exception otherwise.
455455
456+
:arg message: if specified, provides a custom failure message if the
457+
exception is not raised
458+
:arg match: if specified, asserts that the exception matches a text or regex
459+
456460
This helper produces a ``ExceptionInfo()`` object (see below).
457461
458462
You may use this function as a context manager::

changelog/3202.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Sphinx parameter docs for ``match`` and ``message`` args to :func:`pytest.raises`.

0 commit comments

Comments
 (0)