-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
=== short test summary info ===
messages are not useful for ExceptionGroup
s
#12943
Comments
bikeshedding: |
One problem with appending the FAILED foo.py::test_bar - ValueError: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... so unless we want custom logic for the truncation in (you don't get truncation if you run in CI or with |
I think it's okay to truncate here; I'd rather lose the note than the actual message at least - and the group will still be visible if you go look at the specific test. |
I think there's cases where losing the message would be preferably to losing the note, e.g. if you're writing anything equivalent to with pytest.raises(ValueError):
raise ExceptionGroup("", [ValueError("."*100]) then the reason it fails is because it's in a group. And if we make the note somewhat brief it's not going to take up much space, and the reader can quickly skip it when it's been read a million times. and with a leading note we can easily get a format that allows printing multiple exceptions in a logical way:
Though with I suppose truncation introduces another issue here, where you could lose info about the number of exceptions, but we can add that back to the note
|
If there is only a single leaf exception, at any depth, I suggest we produce the short summary message for that leaf exception, and append
[single exception in an ExceptionGroup]
to the message.The text was updated successfully, but these errors were encountered: