-
Notifications
You must be signed in to change notification settings - Fork 4
Use cases for ExceptionGroups #11
Comments
You can also add yourself to the nosy list. |
Another one: https://bugs.python.org/issue40857 Here the ArithmeticError is not really related to the FileNotFoundError, so perhaps tempfile.TemporaryDirectory() should raise them both in an ExceptionGroup so the user has to deal with both. (Note that the fix was to not raise the FileNotFoundError at all, so the issue was sidestepped). |
That's an interesting and good use case. |
Not sure if you mean to solicit external comments, I found this repo through a trio backlink We have a use case for an ExceptionGroup concept in pytest, wrote it up briefly here: pytest-dev/pytest#8217 Similar situation with finalizers also exists in pluggy (a library that pytest, tox and others use for implementing "hooks") but I haven't written it up. |
Thank you @bluetech, that's a useful contribution. |
I'm also keen to use it in Hypothesis - we (optionally) report multiple bugs, including where a single exception can have multiple causes. Currently we have to print the inner tracebacks, which is pretty bad for runtime usecases. It's usually OK for test runners like pytest, unittest, or Django, but assuming they end up ExceptionGroup-aware I'd expect that to work better - in particular our (I know this has been mentioned in other issues, but thought I'd comment as it's not listed in the PEP draft) |
Thank you @Zac-HD, that's an interesting use case and not quite the same as the pytest one. |
These have all been added to the draft. |
I came across https://bugs.python.org/issue29980 and wanted a place to save it, hence this issue.
The text was updated successfully, but these errors were encountered: