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

Fixed issue shadowing error when missing argument on teardown_method #1605

Merged
merged 1 commit into from
Jun 12, 2016

Conversation

guyzmo
Copy link
Contributor

@guyzmo guyzmo commented 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.

@guyzmo
Copy link
Contributor Author

guyzmo commented Jun 11, 2016

  • Target: for bug or doc fixes, target master; for new features, target features
  • Make sure to include one or more tests for your change
  • Add yourself to AUTHORS
  • Add a new entry to the CHANGELOG (choose any open position to avoid merge conflicts with other PRs)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 92.203% when pulling fc7c104 on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 92.203% when pulling fc7c104 on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 92.214% when pulling 36adf00 on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 92.214% when pulling b844bef on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

@@ -6,7 +6,8 @@
* Text documents without any doctests no longer appear as "skipped".
Thanks `@graingert`_ for reporting and providing a full PR (`#1580`_).

*
* Fix internal error issue when `method` argument is missing for
`teardown_method`. Fixes (`#1605`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small ReST issues with this:

  • Use double backticks for monospace
  • Probably want to drop the parens
  • You'll need to add #1605 to the link list further down

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'm not really used to ReST, got a strong preference for markdown syntax. BTW, I mimicked the syntax around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 92.214% when pulling bbd8986 on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

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 <guyzmo+github@m0g.net>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 92.214% when pulling accd962 on guyzmo:issue/1604 into 577cce2 on pytest-dev:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants