]> granicus.if.org Git - python/commitdiff
Issue #25783: Fixed test_traceback when run directly (without regrtest).
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 7 Oct 2016 20:45:42 +0000 (23:45 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 7 Oct 2016 20:45:42 +0000 (23:45 +0300)
Lib/test/test_traceback.py

index b4b74d3fccc0da81f9eb77436bd3b49ec0173d90..49cedda5508f027bef309cd78737e5eb3f667c79 100644 (file)
@@ -688,8 +688,12 @@ class TestFrame(unittest.TestCase):
 class TestStack(unittest.TestCase):
 
     def test_walk_stack(self):
-        s = list(traceback.walk_stack(None))
-        self.assertGreater(len(s), 10)
+        def deeper():
+            return list(traceback.walk_stack(None))
+        s1 = list(traceback.walk_stack(None))
+        s2 = deeper()
+        self.assertEqual(len(s2) - len(s1), 1)
+        self.assertEqual(s2[1:], s1)
 
     def test_walk_tb(self):
         try: