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

Method test_fileno

Lib/test/test_fileinput.py:219–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

217## self.assertEqual(lines, ["A\n", "B"])
218
219 def test_fileno(self):
220 t1 = self.writeTmp("A\nB")
221 t2 = self.writeTmp("C\nD")
222 fi = FileInput(files=(t1, t2), encoding="utf-8")
223 self.assertEqual(fi.fileno(), -1)
224 line = next(fi)
225 self.assertNotEqual(fi.fileno(), -1)
226 fi.nextfile()
227 self.assertEqual(fi.fileno(), -1)
228 line = list(fi)
229 self.assertEqual(fi.fileno(), -1)
230
231 def test_invalid_opening_mode(self):
232 for mode in ('w', 'rU', 'U'):

Callers

nothing calls this directly

Calls 7

filenoMethod · 0.95
nextfileMethod · 0.95
FileInputClass · 0.90
listClass · 0.85
writeTmpMethod · 0.80
assertNotEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected