def test_basics(self): linecache.clearcache() linecache.lazycache("f", fake_module) f = traceback.FrameSummary("f", 1, "dummy") self.assertEqual( ("f", 1, "dummy", '"""Test cases for traceback module"""'), tuple(f)) self.assertEqual(None, f.locals)
def test_lazy_lines(self): linecache.clearcache() f = traceback.FrameSummary("f", 1, "dummy", lookup_line=False) self.assertEqual(None, f._line) linecache.lazycache("f", fake_module) self.assertEqual( '"""Test cases for traceback module"""', f.line)
def test_explicit_line(self): f = traceback.FrameSummary("f", 1, "dummy", line="line") self.assertEqual("line", f.line)