-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
bugfix for issue #2491 #2791
bugfix for issue #2491 #2791
Conversation
…es the original traceback. In python2 it will show the original traceback with a new message that explains in which plugin. In python3 it will show 2 canonized exceptions, the original exception while loading the plugin in addition to an exception that PyTest throws about loading a plugin.
…s that the original traceback has been shown to the users
the tests failed but i don't understand why can someone plz explain to me? |
Looks like a glitch on travis - nothing to do with your changes. |
Indeed this is fixed by #2790 |
ok, so what can i do? |
You can close and reopen the pr then the tests are triggered again. |
Actually #2790 has not been merged yet. @OfirOshir please hold on until we merge it, thanks for your patience. |
changelog/2491.bugfix
Outdated
@@ -0,0 +1,4 @@ | |||
If an exception happens while loading a plugin, PyTest no longer hides the original traceback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually pytest
, not PyTest
. 😉
ups ... sorry 😊 |
No worries! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks 👍 |
new_exc = new_exc_type(new_exc_message) | ||
|
||
six.reraise(new_exc_type, new_exc, sys.exc_info()[2]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this verbose? Why not do it this way?
six.reraise(ImportError, ImportError('Error importing plugin "%s": %s' % (modname, safe_str(e.args[0]))), sys.exc_info()[2])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well both versions are correct, it is more of a matter of style in this case I guess.
Thanks for submitting a PR, your contribution is really appreciated!
Here's a quick checklist that should be present in PRs:
$issue_id.$type
for example (588.bug)removal
,feature
,bugfix
,vendor
,doc
ortrivial
bugfix
,vendor
,doc
ortrivial
fixes, targetmaster
; for removals or features targetfeatures
;Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:
AUTHORS
;