def test_no_ending_newline(self):
    self.addCleanup(support.unlink, support.TESTFN)
    with open(support.TESTFN, 'w') as fp:
        fp.write(SOURCE_3)
    lines = linecache.getlines(support.TESTFN)
    self.assertEqual(lines, ['\n', 'def f():\n', '    return 3\n'])
def test_no_ending_newline(self):
    self.addCleanup(support.unlink, support.TESTFN)
    with open(support.TESTFN, 'w') as fp:
        fp.write(SOURCE_3)
    lines = linecache.getlines(support.TESTFN)
    self.assertEqual(lines, ['\n', 'def f():\n', '    return 3\n'])