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

Possible integrations with better-exceptions #3703

Closed
jnoortheen opened this issue Jul 22, 2018 · 5 comments
Closed

Possible integrations with better-exceptions #3703

jnoortheen opened this issue Jul 22, 2018 · 5 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@jnoortheen
Copy link

Is it possible to use better-exceptions ?.

It is better to see the local state of variables upon failing. It helps to fixing it quickly.
Or there is any way to catch the exceptions as a pytest plugin and use this library to format the exception traceback?

@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #664 (Assertions about expected exceptions documentation possible code error), #3144 (Exit exception), #1122 (Better trace reporting for chained exceptions), #1293 (Better default colours), and #2491 (import_plugin hides exception source).

@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jul 22, 2018
@RonnyPfannschmidt
Copy link
Member

@jnoortheen as far as i understood pytest already does somehing comparable with its traceback, and with the -l option you can get all locals

@jnoortheen
Copy link
Author

Yes that is right. But it returns only the locals of last frame. This library will show the locals in all the frames/function calls up to the start. It is not perfect but highly helpful debugging.
is it possible to catch the exception using any plugin, so I can pass it to this library?

@RonnyPfannschmidt
Copy link
Member

pytest has various hooks to interact with the exception, i believe the make report hook is the perfect place to grab the exception info and pass it on to the lib

@jnoortheen
Copy link
Author

That is looks like a good place to start. I will check that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants