-
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
Switch from MultipleFailures
to PEP-654 ExceptionGroup
#3308
Conversation
c76e787
to
557b8be
Compare
314b2cf
to
ef13005
Compare
ef13005
to
e274034
Compare
3eda335
to
36870b3
Compare
Using the new features from PEP-654 and PEP-678, exception groups and enriching exceptions with notes
36870b3
to
04b4d0e
Compare
@HypothesisWorks/hypothesis-python-contributors - with Python 3.11 rc1 next Monday, I'm hoping to merge this soon.
|
Had been using this for a bit last week for a test suite that uses Hypothesis extensively (but not particularly weirdly), and this didn't break anything... take that as you will! The only change I've felt is yeah, not seeing the multiple tracebacks when there are multiple failures in a typical pytest run. Leaving sub-exception traceback display for Just to note, the current
I suppose this is the kind of stuff that has got you pytest folks interested in adopting Rich heh. In any case, I still think this tree is preferable to how Hypothesis currently displays multiple tracebacks. EDIT: oh the tree is just the traceback message from |
Knowing that it works in practice is super useful, thank you! I know it's well-tested, but whether the tests cover all the use-cases is harder to check 😅
Indeed - download stats indicate that ~40% downloads are for the latest version, which was released in April, and based on other projects I track loosely there's something like 30% of downloads usually unpinned. |
@honno: https://github.com/data-apis/dataframe-interchange-tests/blob/73e4f74eb53eb04bc9632ea243d8b167c458dbfe/tests/test_from_dataframe.py#L11-L14 Looking at this test, you get exhaustive coverage of |
Ayup, I think with just the single round-trips I wrote a gazillion bug reports for adopting libraries, so I kinda forgot to do this heh. |
Using the new features from PEP-654 and PEP-678, exception groups and enriching exceptions with notes.
Draft because I'm not quite done updating tests yet - and will want to do some further manual confirmation that the output looks good too - but this will close #3175 when merged.
traceback.format_exception_only()
) makes Pytest show PEP-678 notesBuildContext.close()
could raiseExceptionGroup
for failed cleanup tasks instead of just printing tracebackscapsys
, orcapture_out()
to ensure that they're still correct with use of notes.ExceptionGroup.exceptions
(i.e. the actual errors!) unless you use--tb=native
Pytest does not show inner exceptions in PEP-654ExceptionGroup
s pytest-dev/pytest#9159report_multiple_bugs
reporting when running on old pytest without--tb=native
rich.traceback
support [REQUEST]rich.traceback
should handleExceptionGroup
and__notes__
Textualize/rich#2238