-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
sys.excepthook is not called #535
Comments
Original comment by Florian Bruhin (Bitbucket: The-Compiler, GitHub: The-Compiler) This doesn't call FWIW |
Hmm, interesting. Technically, coverage.py doesn't disable the exception handler, but it does catch all the exceptions at the top of the stack. I guess coverage/execfile.py needs to invoke the excepthook explicitly? |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) The exception is caught and the traceback printed in cmdline.py. Although sys.excepthook is properly set, it does not get a chance to run. |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) Tentative fix at https://bitbucket.org/ned/coveragepy/pull-requests/96/honor-sysexcepthook/diff |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) For the record, another pull request at https://bitbucket.org/ned/coveragepy/pull-requests/93/explicitely-call-sysexcepthook/diff which I missed tries patching execfile instead |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) I declined my pull request because I think Andrew Hoos pull request is a better fix. |
Fixed by pull request 93: https://bitbucket.org/ned/coveragepy/pull-requests/93/explicitely-call-sysexcepthook/diff And by the commits following, up to 60e9b1b2f820 (bb). |
This fix was released as part of Coverage.py 4.3. |
Originally reported by Andrew Hoos (Bitbucket: andrewhoos, GitHub: andrewhoos)
This file does not call the
handle_exception
function when it is run through coverage, but it does when called through python. The global exception provides significant functionality that would be great to test. But I can't test with coverage because it disables the exception handler which changes the results of the test in question.The text was updated successfully, but these errors were encountered: