Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
add `versionadded`

Co-authored-by: Bruno Oliveira <[email protected]>
  • Loading branch information
jakkdl and nicoddemus authored Feb 18, 2025
1 parent c011e9b commit 426fe19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/_pytest/_raises_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ def _check_type(self, exception: BaseException) -> TypeGuard[BaseExcT_co_default

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

0 comments on commit 426fe19

Please sign in to comment.