mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
make bad file descriptor tests more robust
This commit is contained in:
parent
c84ebe73a7
commit
5539c78391
3 changed files with 32 additions and 15 deletions
|
|
@ -7,7 +7,8 @@ import unittest
|
|||
from array import array
|
||||
from weakref import proxy
|
||||
|
||||
from test.test_support import TESTFN, findfile, check_warnings, run_unittest
|
||||
from test.test_support import (TESTFN, findfile, check_warnings, run_unittest,
|
||||
make_bad_fd)
|
||||
from UserList import UserList
|
||||
|
||||
import _fileio
|
||||
|
|
@ -178,7 +179,7 @@ class OtherFileTests(unittest.TestCase):
|
|||
|
||||
def testInvalidFd(self):
|
||||
self.assertRaises(ValueError, _fileio._FileIO, -10)
|
||||
self.assertRaises(OSError, _fileio._FileIO, 10)
|
||||
self.assertRaises(OSError, _fileio._FileIO, make_bad_fd())
|
||||
|
||||
def testBadModeArgument(self):
|
||||
# verify that we get a sensible error message for bad mode argument
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue