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

Method test_close_on_exception

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

Source from the content-addressed store, hash-verified

354 self.assertEqual(fi._files, ())
355
356 def test_close_on_exception(self):
357 t1 = self.writeTmp("")
358 try:
359 with FileInput(files=t1, encoding="utf-8") as fi:
360 raise OSError
361 except OSError:
362 self.assertEqual(fi._files, ())
363
364 def test_empty_files_list_specified_to_constructor(self):
365 with FileInput(files=[], encoding="utf-8") as fi:

Callers

nothing calls this directly

Calls 3

FileInputClass · 0.90
writeTmpMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected