Skip to content

Commit 0b4a557

Browse files
BoWuGitnicoddemus
andauthored
Extend pytest.raises to support Exception having __repr__ method and initialized with kwargs (#11073)
Co-authored-by: Bruno Oliveira <[email protected]>
1 parent ffdcce6 commit 0b4a557

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Ben Gartner
5757
Ben Webb
5858
Benjamin Peterson
5959
Bernard Pratz
60+
Bo Wu
6061
Bob Ippolito
6162
Brian Dorsey
6263
Brian Larsen

src/_pytest/python_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ def raises( # noqa: F811
812812
:kwparam str | typing.Pattern[str] | None match:
813813
If specified, a string containing a regular expression,
814814
or a regular expression object, that is tested against the string
815-
representation of the exception using :func:`re.search`.
815+
representation of the exception and its `PEP-678 <https://peps.python.org/pep-0678/>` `__notes__`
816+
using :func:`re.search`.
816817
817818
To match a literal string that may contain :ref:`special characters
818819
<re-syntax>`, the pattern can first be escaped with :func:`re.escape`.

0 commit comments

Comments
 (0)