Skip to content

Commit

Permalink
Extend pytest.raises to support Exception having __repr__ method and …
Browse files Browse the repository at this point in the history
…initialized with kwargs (pytest-dev#11073)

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
  • Loading branch information
BoWuGit and nicoddemus committed Jul 20, 2023
1 parent ffdcce6 commit 0b4a557
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Ben Gartner
Ben Webb
Benjamin Peterson
Bernard Pratz
Bo Wu
Bob Ippolito
Brian Dorsey
Brian Larsen
Expand Down
3 changes: 2 additions & 1 deletion src/_pytest/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@ def raises( # noqa: F811
:kwparam str | typing.Pattern[str] | None match:
If specified, a string containing a regular expression,
or a regular expression object, that is tested against the string
representation of the exception using :func:`re.search`.
representation of the exception and its `PEP-678 <https://peps.python.org/pep-0678/>` `__notes__`
using :func:`re.search`.
To match a literal string that may contain :ref:`special characters
<re-syntax>`, the pattern can first be escaped with :func:`re.escape`.
Expand Down

0 comments on commit 0b4a557

Please sign in to comment.