-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
add RaisesGroup & Matcher #13192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add RaisesGroup & Matcher #13192
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c93130c
add RaisesGroup & Matcher
jakkdl 4737c8c
add AbstractMatcher support to xfail
jakkdl e1e1874
rename AbstractMatcher -> AbstractRaises, Matcher->RaisesExc. Add doc…
jakkdl e090517
Merge branch 'main' into raisesgroup
jakkdl e73c411
fix test on py<311
jakkdl c011e9b
fix test, fix references in docstrings
jakkdl 426fe19
Apply suggestions from code review
jakkdl 7f9966b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0cdc5da
Update src/_pytest/_raises_group.py
jakkdl cb30674
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9714dc0
doc improvements after review
jakkdl ad6542e
Merge remote-tracking branch 'origin/main' into raisesgroup
jakkdl 4d2c709
fix imports after file rename
jakkdl 9e38a9e
fix another import
jakkdl ff9dd38
sed s/RaisesGroups/RaisesGroup
jakkdl 2c8cd64
make pytest.raises use RaisesExc... which made me notice about a mill…
jakkdl 09d06fe
fix tests
jakkdl 753df94
harmonize stringify_exception, various comments
jakkdl 4f682c1
fix rtd
jakkdl edfcc86
Merge branch 'main' into raisesgroup
jakkdl 309030c
fix import loop
jakkdl 4e97652
remove raises_group alias, doc fixes after review
jakkdl 5186f36
Merge remote-tracking branch 'origin/main' into raisesgroup
jakkdl 9163167
Merge remote-tracking branch 'origin/main' into raisesgroup
jakkdl d37e6d6
Update 11538.feature.rst
jakkdl 4c6ded7
docs fixes after removing the raises_group alias.
jakkdl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added :class:`pytest.RaisesGroup` as an equivalent to :func:`pytest.raises` for expecting :exc:`ExceptionGroup`. Also adds :class:`pytest.RaisesExc` which is now the logic behind :func:`pytest.raises` and used as parameter to :class:`pytest.RaisesGroup`. ``RaisesGroup`` includes the ability to specify multiple different expected exceptions, the structure of nested exception groups, and flags for emulating :ref:`except* <except_star>`. See :ref:`assert-matching-exception-groups` and docstrings for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:func:`pytest.mark.xfail` now accepts :class:`pytest.RaisesGroup` for the ``raises`` parameter when you expect an exception group. You can also pass a :class:`pytest.RaisesExc` if you e.g. want to make use of the ``check`` parameter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.