def test_simple(self): try: self.raise_(4) except RuntimeError: tb = sys.exc_info()[2] tb_cut = script.cut_traceback(tb, "test_simple") assert len(traceback.extract_tb(tb_cut)) == 5 tb_cut2 = script.cut_traceback(tb, "nonexistent") assert len(traceback.extract_tb(tb_cut2)) == len(traceback.extract_tb(tb))