Explorar o código

tests: improve clearing tracebacks from Qubes* objects

Clear also tracebacks of chained exceptions.
Marek Marczykowski-Górecki %!s(int64=5) %!d(string=hai) anos
pai
achega
35c66987ab
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      qubes/tests/__init__.py

+ 4 - 1
qubes/tests/__init__.py

@@ -391,7 +391,10 @@ class QubesTestCase(unittest.TestCase):
                 continue
             if exc_info is None:
                 continue
-            traceback.clear_frames(exc_info[2])
+            ex = exc_info[1]
+            while ex is not None:
+                traceback.clear_frames(ex.__traceback__)
+                ex = ex.__context__
 
     def cleanup_gc(self):
         gc.collect()