-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
When missing the method
argument of teardown_method
, getting INTERNALERROR
#1604
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
Comments
i consider keeping the last item a good idea for a starting point a full pr would also need a test exposing the issue i would propose at a later point to switch pruning with collapsing, so there would be "collapsed pytest internals" entry |
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 11, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 11, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 11, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 11, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 11, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
guyzmo
added a commit
to guyzmo/pytest
that referenced
this issue
Jun 12, 2016
When the method argument is missing on teardown_method, the traceback is 100% internal to pytest, which with default options get pruned. Then that traceback is empty, leading to a new exception as a traceback shall not be empty. This PR fixes that issue by pushing back the last stack on the traceback, when the stacktrace is empty after pruning. Then the output is still pruned, but gives meaningful information with the item where it failed on the stack. * fixes issue pytest-dev#1604 Signed-off-by: Guyzmo <[email protected]>
Fixed in current master. |
This was referenced Apr 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context: I'm using pytest 2.9.2, on Python 3.5, with a bunch of plugins (see outputs).
I have setup a tests module in my project with a test class similar to:
tests/test_project.py:
I ran it, and obtained the following traceback:
I ran the test again with
--fulltraceback
and had the traceback telling me that I'm wrong, with no issue (cf that gist).After some discussion on
#pylib
with @RonnyPfannschmidt, we figured out it's definitely the traceback pruning that's at fault: the exception is thrown withinpytest
, so when pruning all pytest stuff, there's nothing left.So as a solution we could do the following to avoid pruning if the last stack entry is from a file in the pytest lib:
at line
387
of_pytest/main.py
:which will return the full stacktrace, as we're avoiding pruning it altogether. It's ok, but I'm not found of the test itself… it's a bit too Q&D.
or we could do the following version that prunes everything, showing only the last item of the stack, where there's useful information to debug:
at line
387
of_pytest/main.py
:which gives:
I'd be happy to submit a PR for solving this… But I guess it needs some discussion on whether either of my suggestions are good to solve the issue or not.
The text was updated successfully, but these errors were encountered: