Skip to content
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

Improve traceback printing for MultipleFailures #3116

Closed
Zac-HD opened this issue Oct 14, 2021 · 0 comments · Fixed by #3130
Closed

Improve traceback printing for MultipleFailures #3116

Zac-HD opened this issue Oct 14, 2021 · 0 comments · Fixed by #3130
Labels
legibility make errors helpful and Hypothesis grokable

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Oct 14, 2021

When Hypothesis reports multiple failures, we print the tracebacks of each error we found and then raise a MultipleFailures exception. However, it would be nice to improve these printed tracebacks!

  • If we're running under pytest, we should use pytest's traceback-printing logic - and respect the --tb argument for short, native, long, skipped (etc) formatting.
  • Otherwise, if rich is installed we can use that like Let's get rich hynek/structlog#349 (and it's already an optional dependency for hypothesis[cli], to syntax-highlight ghostwritten code)
  • And finally we can fall back to better-exceptions like Add support for better-exceptions hynek/structlog#330

See also python/cpython#28569 (comment): in Python 3.11 we'll want to work with ExceptionGroup, but there are some open questions about how to add our extra information to the display (minimal example, targets, error explanation, etc) that are still up for discussion in bugs.python.org/issue45607

@Zac-HD Zac-HD added the legibility make errors helpful and Hypothesis grokable label Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legibility make errors helpful and Hypothesis grokable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant