summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileio.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-19 17:37:42 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-19 17:37:42 (GMT)
commit5539c783912d1cc84d9df16322e1083866ad2033 (patch)
tree534c7c8673db7a82b7e0873ef4ae4381d3d2f3d2 /Lib/test/test_fileio.py
parentc84ebe73a794ae6a50cd380f4f8a71856c095c6e (diff)
downloadcpython-5539c783912d1cc84d9df16322e1083866ad2033.zip
cpython-5539c783912d1cc84d9df16322e1083866ad2033.tar.gz
cpython-5539c783912d1cc84d9df16322e1083866ad2033.tar.bz2
make bad file descriptor tests more robust
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r--Lib/test/test_fileio.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index c089608..04c7b45 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -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