-
Notifications
You must be signed in to change notification settings - Fork 587
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
Simple initial uses of ExceptionGroup
#3372
Conversation
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.
Thanks! This was interesting. I'm still trying to wrap my head around the little details of ExceptionGroup
implementation.
Also, a question about exceptiongroups
package. It has this section: https://github.com/agronholm/exceptiongroup#notes-on-monkey-patching Can it be a problem for us in any way? 🤔
if errors: | ||
if len(errors) == 1: | ||
raise errors[0] from exc_value | ||
raise BaseExceptionGroup("Cleanup failed", errors) from exc_value |
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.
Question: do we need to use from
with exception groups? I've never tried it :)
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.
https://docs.python.org/3/tutorial/errors.html#exception-chaining
It just indicates that we're deliberately replacing the previous exception, instead of hitting another error while handling it.
The monkey patching is actually pretty important here - without it, we wouldn't display eg notes on previous versions. |
Just as an FYI, I've discovered that depending on the |
Unfortunately there's not much I can do here; the conda-forge package for Hypothesis is not provided or endorsed by the Hypothesis maintainers. My main reaction is "maybe mamba should support pre-releases then"! |
Sure, I understand.
Right. That'll be my next step too, I guess. |
Good luck! I do really appreciate the report, even if I can't help directly 😅 |
Extracted from #3308 (see also #3175) for the sake of smaller and easier-to-read diffs.
I'll then try to pick up just the
__notes__
changes in a separate PR, and defer the replacement ofMultipleFailures
until Pytest displaysExceptionGroup
inner exceptions.