-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add new ExceptionInfo.group_contains
assertion helper method
#11424
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
Conversation
Curious, these failures don't seem to have anything to do with my changes 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great Mihail - thanks so much!
I've added some design comments below which I think will let us close the linked issue; your implementation and tests already look great so we should be able to merge pretty soon. I'm also unsure what's happening with those failing tests, but rebasing on main might help?
@Zac-HD I've updated the PR with the suggested changes. |
I think it'd be nice to add a usage example to the reference docs for |
Updated docs as well 👍 |
Tests if a captured exception group contains an expected exception. Will raise `AssertionError` if the wrapped exception is not an exception group. Supports recursive search into nested exception groups.
…bout the `match` keyword parameter)
c808cae
to
5ace48c
Compare
Also rebased onto |
Beautiful! Thanks so much @lanzz, I'm going to really enjoy using this 🤩 |
@Zac-HD when merging, prefer to squash the commits when they do not bring much value if they land separately into IMHO those commits would be better squashed together as a single commit. 👍 |
Tests if a captured exception group contains an expected exception. Will raise
AssertionError
if the wrapped exception is not an exception group. Supports recursive search into nested exception groups.(edit by Zac) Fixes #10441.