示例#1
0
文件: test_dream.py 项目: ieure/dream
    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])
示例#2
0
文件: test_dream.py 项目: ieure/dream
 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"])