-
Notifications
You must be signed in to change notification settings - Fork 15
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
Hide traceback lines from library #52
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the traceback output goes something like this (with
pytest --tb=native
):It would be nice if the lines originating from grappa internals could be hidden from the traceback output. pytest has
__tracebackhide__
which can be set on a whole module IIRC, but that won't have any effect with--tb=native
.Now, the extent to which this is possible, is probably limited.
sys.excepthook
might be an option, but should be opt-in as it may override other custom traceback formatters. Also, AFAIKpytest ignores this hook completely and prints out their exceptions on their own. Maybe catch the exception at the top-level of the library, adjust the traceback to remove the library frames, and re-raise? Or a pytest formatter plugin to complement the
excepthook
?The text was updated successfully, but these errors were encountered: