-
-
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
Show traceback during collection #1979
Show traceback during collection #1979
Conversation
Also omit pytest's own modules and internal libraries (py and pluggy) in low verbosity Fix pytest-dev#1976
import not_exists | ||
""") | ||
result = testdir.runpytest(p) | ||
assert "__import__" not in result.stdout.str(), "too long 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.
This test was here to explicitly cut back the traceback from the error message, but unfortunately this makes it more difficult to find bugs.
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() |
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.
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.
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.
please a comment in the code
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.
Ops, good point.
No idea why the |
Fixes #1976.
Here's the output:
master
this PR
this PR with -vv