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

Method test_close

Lib/idlelib/idle_test/test_run.py:208–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 self.assertRaises(TypeError, f.readlines, 1, 1)
207
208 def test_close(self):
209 shell = MockShell()
210 f = run.StdInputFile(shell, 'stdin')
211 shell.push(['one\n', 'two\n', ''])
212 self.assertFalse(f.closed)
213 self.assertEqual(f.readline(), 'one\n')
214 f.close()
215 self.assertFalse(f.closed)
216 self.assertEqual(f.readline(), 'two\n')
217 self.assertRaises(TypeError, f.close, 1)
218
219
220class StdOutputFilesTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

pushMethod · 0.95
readlineMethod · 0.95
closeMethod · 0.95
MockShellClass · 0.85
assertFalseMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected