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

Pytest should display PEP-678 exception notes in long, auto, and short traceback print modes #9896

Closed
Zac-HD opened this issue Apr 27, 2022 · 1 comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Apr 27, 2022

Pytest has six traceback print modes - auto (the default), long, short, no, line, or native - which can be selected with the --tb= command-line option. Currently, PEP-678 notes are only displayed in native mode, which is likely to become a problem as various libraries add notes (e.g. here). Ideally, we could get support out to most pytest users before Python 3.11 final, so that everything just works.

I think that we probably don't want to display notes in line or no modes, but the others should.

@Zac-HD Zac-HD added type: enhancement new feature or API change, should be merged into features branch topic: reporting related to terminal output and user-facing messages and errors labels Apr 27, 2022
@Zac-HD
Copy link
Member Author

Zac-HD commented Apr 28, 2022

It looks like this is better addressed in the exceptiongroup backport, by patching traceback.TracebackException.format_exception_only()

@Zac-HD Zac-HD closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant