mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
raise an OSError for invalid fds #4991
This commit is contained in:
parent
b6e112bd95
commit
5848d1ff35
3 changed files with 27 additions and 0 deletions
|
@ -176,6 +176,10 @@ class OtherFileTests(unittest.TestCase):
|
|||
f.close()
|
||||
os.unlink(TESTFN)
|
||||
|
||||
def testInvalidFd(self):
|
||||
self.assertRaises(ValueError, _fileio._FileIO, -10)
|
||||
self.assertRaises(OSError, _fileio._FileIO, 10)
|
||||
|
||||
def testBadModeArgument(self):
|
||||
# verify that we get a sensible error message for bad mode argument
|
||||
bad_mode = "qwerty"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue