Show traceback during collection#1979
Merged
nicoddemus merged 2 commits intopytest-dev:masterfrom Oct 5, 2016
Merged
Conversation
Also omit pytest's own modules and internal libraries (py and pluggy) in low verbosity Fix pytest-dev#1976
nicoddemus
commented
Oct 4, 2016
| import not_exists | ||
| """) | ||
| result = testdir.runpytest(p) | ||
| assert "__import__" not in result.stdout.str(), "too long traceback" |
Member
Author
There was a problem hiding this comment.
This test was here to explicitly cut back the traceback from the error message, but unfortunately this makes it more difficult to find bugs.
nicoddemus
commented
Oct 4, 2016
| exc_info = ExceptionInfo() | ||
| if self.config.getoption('verbose') < 2: | ||
| exc_info.traceback = exc_info.traceback.filter(filter_traceback) | ||
| exc_repr = exc_info.getrepr(style='short') if exc_info.traceback else exc_info.exconly() |
Member
Author
There was a problem hiding this comment.
Decided to hard-code it to short because it is usually enough to track import problems and long may generate too much output during collection.
Member
There was a problem hiding this comment.
please a comment in the code
Member
Author
|
No idea why the |
This was referenced Oct 4, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1976.
Here's the output:
master
this PR
this PR with -vv