示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def test_explicit_line(self):
     f = traceback.FrameSummary("f", 1, "dummy", line="line")
     self.assertEqual("line", f.line)