exception stack depth not restricted to relevant modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Fix Released
|
Wishlist
|
Jonathan Lange |
Bug Description
Hi!
I'm just playing around with testtools trying to understand what I need to do to use them.
One thing I noticed is that when a test fails, I get the complete interpreter stack in the exception:
Traceback (most recent call last):
File "/usr/lib/
return fn(*args, **kwargs)
File "/usr/lib/
return self._get_
File "./test-tt.py", line 17, in test_foo
self.
File "/usr/lib/
self.
File "/usr/lib/
% (matchee, matcher, mismatch.
AssertionError: Match failed. Matchee: "0"
Matcher: Equals(1)
Difference: 1 != 0
But most of that information is irrelevant, and I don't want to be trawling through it trying to work out what's going on.
In "unittest", it gets truncated to just the relevant parts:
Traceback (most recent call last):
File "./test.py", line 15, in test_foo
self.
AssertionError: 1 != 0
It looks like unittest has some code to strip out the junk, in the shape of functions _is_relevant_
I started looking to see where this could be fixed but couldn't see quite the cleanest way.
Related branches
- Robert Collins: Needs Fixing
-
Diff: 186 lines (+18/-8)14 files modifiedNEWS (+3/-0)
testtools/__init__.py (+1/-0)
testtools/content.py (+2/-0)
testtools/content_type.py (+2/-0)
testtools/matchers.py (+1/-0)
testtools/run.py (+2/-0)
testtools/runtest.py (+1/-0)
testtools/testcase.py (+1/-0)
testtools/testresult/__init__.py (+1/-0)
testtools/testresult/doubles.py (+1/-0)
testtools/testresult/real.py (+1/-0)
testtools/tests/test_testresult.py (+0/-8)
testtools/testsuite.py (+1/-0)
testtools/utils.py (+1/-0)
- Robert Collins: Approve
- Diff: 0 lines
Changed in testtools: | |
assignee: | nobody → Jonathan Lange (jml) |
status: | Triaged → In Progress |
tags: | added: over-verbosity |
Changed in testtools: | |
status: | In Progress → Fix Committed |
milestone: | none → next |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
I thought we had a dupe of this but I can't find it.
It would be good to hide irrelevant frames, though that definition gets tricky when you consider we develop testtools with testtools.