diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-03-22 00:15:53 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-03-22 00:15:53 (GMT) |
commit | dccc1fcfafd37c6fd94ca766516cb4903b29668e (patch) | |
tree | c61f70185ef656a1b6d80481d3cc1833ce3925d4 /Lib/test | |
parent | a6884fc0fdc46b88a006972d8e8e15f39359336e (diff) | |
download | cpython-dccc1fcfafd37c6fd94ca766516cb4903b29668e.zip cpython-dccc1fcfafd37c6fd94ca766516cb4903b29668e.tar.gz cpython-dccc1fcfafd37c6fd94ca766516cb4903b29668e.tar.bz2 |
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.
........
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_unittest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index b4716a4..954b40a 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -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__'): |