mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Merged revisions 79263 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79263 | michael.foord | 2010-03-21 19:06:30 -0500 (Sun, 21 Mar 2010) | 1 line Issue 7815. __unittest in module globals trims frames from reported stacktraces in unittest. ........
This commit is contained in:
parent
a6884fc0fd
commit
dccc1fcfaf
10 changed files with 30 additions and 5 deletions
|
@ -2096,6 +2096,16 @@ class Test_TestResult(TestCase):
|
|||
'Tests getDescription() for a method with a longer '
|
||||
'docstring.'))
|
||||
|
||||
def testStackFrameTrimming(self):
|
||||
class Frame(object):
|
||||
class tb_frame(object):
|
||||
f_globals = {}
|
||||
result = unittest.TestResult()
|
||||
self.assertFalse(result._is_relevant_tb_level(Frame))
|
||||
|
||||
Frame.tb_frame.f_globals['__unittest'] = True
|
||||
self.assertTrue(result._is_relevant_tb_level(Frame))
|
||||
|
||||
classDict = dict(unittest.TestResult.__dict__)
|
||||
for m in ('addSkip', 'addExpectedFailure', 'addUnexpectedSuccess',
|
||||
'__init__'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue