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

Method test_close

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

Source from the content-addressed store, hash-verified

316 self.assertEqual(shell.written, [])
317
318 def test_close(self):
319 shell = MockShell()
320 f = run.StdOutputFile(shell, 'stdout')
321 self.assertFalse(f.closed)
322 f.write('test')
323 f.close()
324 self.assertTrue(f.closed)
325 self.assertRaises(ValueError, f.write, 'x')
326 self.assertEqual(shell.written, [('test', 'stdout')])
327 f.close()
328 self.assertRaises(TypeError, f.close, 1)
329
330
331class RecursionLimitTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

writeMethod · 0.95
MockShellClass · 0.85
assertFalseMethod · 0.80
assertTrueMethod · 0.80
closeMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected