MCPcopy Index your code
hub / github.com/python/cpython / test_getline

Method test_getline

Lib/test/test_linecache.py:62–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60 super().setUp()
61
62 def test_getline(self):
63 with tokenize.open(self.file_name) as fp:
64 for index, line in enumerate(fp):
65 if not line.endswith('\n'):
66 line += '\n'
67
68 cached_line = linecache.getline(self.file_name, index + 1)
69 self.assertEqual(line, cached_line)
70
71 def test_getlines(self):
72 lines = linecache.getlines(self.file_name)

Callers

nothing calls this directly

Calls 5

enumerateFunction · 0.85
openMethod · 0.45
endswithMethod · 0.45
getlineMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected