summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_select.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_select.py')
-rw-r--r--Lib/test/test_select.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
index fe92f45..3144c54 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -1,8 +1,9 @@
-from test import support
-import unittest
-import select
+import errno
import os
+import select
import sys
+import unittest
+from test import support
@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
@@ -20,6 +21,21 @@ class SelectTestCase(unittest.TestCase):
self.assertRaises(TypeError, select.select, [self.Nope()], [], [])
self.assertRaises(TypeError, select.select, [self.Almost()], [], [])
self.assertRaises(TypeError, select.select, [], [], [], "not a number")
+ self.assertRaises(ValueError, select.select, [], [], [], -1)
+
+ # Issue #12367: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/155606
+ @unittest.skipIf(sys.platform.startswith('freebsd'),
+ 'skip because of a FreeBSD bug: kern/155606')
+ def test_errno(self):
+ with open(__file__, 'rb') as fp:
+ fd = fp.fileno()
+ fp.close()
+ try:
+ select.select([fd], [], [], 0)
+ except select.error as err:
+ self.assertEqual(err.errno, errno.EBADF)
+ else:
+ self.fail("exception not raised")
def test_returned_list_identity(self):
# See issue #8329