Ejemplo n.º 1
0
    def test_traceback_list(self):
        ex = Exception("Boo")
        ex.__traceback__ = traceback.extract_stack()

        tbk = _format_traceback(ex)
        self.assertTrue(isinstance(tbk, (list, tuple)))
        self.assertTrue(len(tbk) > 0)
        self.assertTrue('test_traceback_list' in tbk[-1])
Ejemplo n.º 2
0
 def test_no_traceback(self):
     tbk = _format_traceback(Exception())
     self.assertTrue(isinstance(tbk, (list, tuple)))
     self.assertTrue(len(tbk) == 1)
     self.assertTrue(tbk == ["No traceback available"])