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

Method test_fcntl_bad_file_overflow

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

Source from the content-addressed store, hash-verified

118
119 @cpython_only
120 def test_fcntl_bad_file_overflow(self):
121 _testcapi = import_module("_testcapi")
122 INT_MAX = _testcapi.INT_MAX
123 INT_MIN = _testcapi.INT_MIN
124 # Issue 15989
125 with self.assertRaises(OverflowError):
126 fcntl.fcntl(INT_MAX + 1, fcntl.F_SETFL, os.O_NONBLOCK)
127 with self.assertRaises(OverflowError):
128 fcntl.fcntl(BadFile(INT_MAX + 1), fcntl.F_SETFL, os.O_NONBLOCK)
129 with self.assertRaises(OverflowError):
130 fcntl.fcntl(INT_MIN - 1, fcntl.F_SETFL, os.O_NONBLOCK)
131 with self.assertRaises(OverflowError):
132 fcntl.fcntl(BadFile(INT_MIN - 1), fcntl.F_SETFL, os.O_NONBLOCK)
133
134 @unittest.skipIf(
135 (platform.machine().startswith("arm") and platform.system() == "Linux")

Callers

nothing calls this directly

Calls 3

import_moduleFunction · 0.90
BadFileClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected