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

Method testErrors

Lib/test/test_io/test_fileio.py:208–220  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 repr(self.f) # Should not crash
207
208 def testErrors(self):
209 f = self.f
210 self.assertFalse(f.isatty())
211 self.assertFalse(f.closed)
212 #self.assertEqual(f.name, TESTFN)
213 self.assertRaises(ValueError, f.read, 10) # Open for reading
214 f.close()
215 self.assertTrue(f.closed)
216 f = self.FileIO(TESTFN, 'r')
217 self.assertRaises(TypeError, f.readinto, "")
218 self.assertFalse(f.closed)
219 f.close()
220 self.assertTrue(f.closed)
221
222 def testMethods(self):
223 methods = ['fileno', 'isatty', 'seekable', 'readable', 'writable',

Callers

nothing calls this directly

Calls 5

isattyMethod · 0.95
closeMethod · 0.95
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected