Add new ExceptionInfo.group_contains assertion helper method#11424
Add new ExceptionInfo.group_contains assertion helper method#11424Zac-HD merged 4 commits intopytest-dev:mainfrom
ExceptionInfo.group_contains assertion helper method#11424Conversation
|
Curious, these failures don't seem to have anything to do with my changes 🤔 |
Zac-HD
left a comment
There was a problem hiding this comment.
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
AssertionErrorif the wrapped exception is not an exception group. Supports recursive search into nested exception groups.(edit by Zac) Fixes #10441.