Skip to content

Commit 426fe19

Browse files
jakkdlnicoddemus
andauthored
Apply suggestions from code review
add `versionadded` Co-authored-by: Bruno Oliveira <[email protected]>
1 parent c011e9b commit 426fe19

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/_pytest/_raises_group.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ def _check_type(self, exception: BaseException) -> TypeGuard[BaseExcT_co_default
290290

291291
@final
292292
class RaisesGroup(AbstractRaises[BaseExceptionGroup[BaseExcT_co]]):
293-
"""Contextmanager for checking for an expected :exc:`ExceptionGroup`.
293+
"""
294+
.. versionadded:: 8.4
295+
296+
Contextmanager for checking for an expected :exc:`ExceptionGroup`.
294297
This works similar to :func:`pytest.raises`, but allows for specifying the structure of an :exc:`ExceptionGroup`.
295298
:meth:`ExceptionInfo.group_contains` also tries to handle exception groups,
296299
but it is very bad at checking that you *didn't* get unexpected exceptions.
@@ -309,7 +312,7 @@ class RaisesGroup(AbstractRaises[BaseExceptionGroup[BaseExcT_co]]):
309312
310313
#. It will only catch exceptions wrapped in an exceptiongroup by default.
311314
312-
* With ``allow_unwrapped=True`` you can specify a single expected exception (or `RaisesExc`) and it will match
315+
* With ``allow_unwrapped=True`` you can specify a single expected exception (or :class:`RaisesExc`) and it will match
313316
the exception even if it is not inside an :exc:`ExceptionGroup`.
314317
If you expect one of several different exception types you need to use a :class:`RaisesExc` object.
315318

0 commit comments

Comments
 (0)