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

Patch format-exception-only too #8

Merged
merged 5 commits into from
Apr 30, 2022

Conversation

Zac-HD
Copy link
Contributor

@Zac-HD Zac-HD commented Apr 30, 2022

Fixes #7, ensuring that e.g. Pytest's traceback formatting (which uses format_exception_only()) will also show notes.

@agronholm
Copy link
Owner

Did the test suite pass for you locally?

@Zac-HD Zac-HD force-pushed the format-exception-only branch 2 times, most recently from 1086e58 to 051d30e Compare April 30, 2022 17:27
@Zac-HD Zac-HD force-pushed the format-exception-only branch from b5917e1 to 0da48ab Compare April 30, 2022 17:38
@agronholm
Copy link
Owner

You should pull in the pre-commit changes (or install the pre-commit hook locally) instead of force pushing the changes.

@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 30, 2022

Sorry for the churn - turns out that when running pytest directly I needed to do a full non-editable install before testing each change. Pre-commit is also now installed and working on my new laptop 👍

@agronholm
Copy link
Owner

Shouldn't the 3.11 tests pass already btw? It runs on 3.11a7 now.

@agronholm
Copy link
Owner

Hm, it does pass for me locally and I'm using the git version beyond a7 so I guess it's all okay.

Copy link
Owner

@agronholm agronholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple code style changes, otherwise looks fine. I'll go ahead and commit those style changes.

src/exceptiongroup/_formatting.py Outdated Show resolved Hide resolved
src/exceptiongroup/_formatting.py Outdated Show resolved Hide resolved
@agronholm agronholm merged commit 9d98801 into agronholm:main Apr 30, 2022
@agronholm
Copy link
Owner

Thanks!

@agronholm
Copy link
Owner

Released v1.0.0rc5.

@Zac-HD Zac-HD deleted the format-exception-only branch May 1, 2022 00:24
@Zac-HD
Copy link
Contributor Author

Zac-HD commented May 1, 2022

Thanks @agronholm! While I'm hoping this is the last time I need to come back here, that's not because I don't appreciate working with you 😀

The .add_note() patch was merged into CPython shortly after a7, so they're on main/mightlies and will be released in beta1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patch traceback.TracebackException.format_exception_only()
2 participants