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

Method check

Lib/test/test_fileinput.py:971–975  ·  view source on GitHub ↗
(errors, expected_lines)

Source from the content-addressed store, hash-verified

969 self.addCleanup(safe_unlink, TESTFN)
970
971 def check(errors, expected_lines):
972 with FileInput(files=TESTFN, mode='r',
973 openhook=hook_encoded('utf-8', errors=errors)) as fi:
974 lines = list(fi)
975 self.assertEqual(lines, expected_lines)
976
977 check('ignore', ['abc'])
978 with self.assertRaises(UnicodeDecodeError):

Callers

nothing calls this directly

Calls 4

FileInputClass · 0.90
hook_encodedFunction · 0.90
listClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected