MCPcopy Create free account
hub / github.com/python/cpython / test_fcntl_bad_file

Method test_fcntl_bad_file

Lib/test/test_fcntl.py:109–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

107 self.f.close()
108
109 def test_fcntl_bad_file(self):
110 with self.assertRaises(ValueError):
111 fcntl.fcntl(-1, fcntl.F_SETFL, os.O_NONBLOCK)
112 with self.assertRaises(ValueError):
113 fcntl.fcntl(BadFile(-1), fcntl.F_SETFL, os.O_NONBLOCK)
114 with self.assertRaises(TypeError):
115 fcntl.fcntl('spam', fcntl.F_SETFL, os.O_NONBLOCK)
116 with self.assertRaises(TypeError):
117 fcntl.fcntl(BadFile('spam'), fcntl.F_SETFL, os.O_NONBLOCK)
118
119 @cpython_only
120 def test_fcntl_bad_file_overflow(self):

Callers

nothing calls this directly

Calls 2

BadFileClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected