-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Python 3.11 has been released with the new ExceptionGroup
type, and there's a great backport too.
As people start to write code which can raise ExceptionGroup
s, there's also going to be a corresponding need to test that they raised the expected group of exceptions, and that's where this issue comes in: our existing APIs aren't particularly helpful for this. For example, in the PR to use ExceptionGroup
s for Pytest teardown errors, I used with pytest.raises(...)
to catch the group, but then had to manually unpack the structure and do isinstance()
checks by hand.
I'd like to take our time and find the right API, rather than hurrying to any particular conclusion, and that should be based on a volume and diversity of experience that just doesn't exist yet. This issue therefore exists to collect use-cases, design ideas, and discussion, until we're confident that we can ship the right thing for the next decade.