summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_poll.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_poll.py')
-rw-r--r--Lib/test/test_poll.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py
index 3b7926d..a2fec3d 100644
--- a/Lib/test/test_poll.py
+++ b/Lib/test/test_poll.py
@@ -1,6 +1,7 @@
# Test case for the os.poll() function
import os, select, random, unittest, subprocess
+import _testcapi
from test.support import TESTFN, run_unittest
try:
@@ -151,6 +152,15 @@ class PollTests(unittest.TestCase):
if x != 5:
self.fail('Overflow must have occurred')
+ pollster = select.poll()
+ # Issue 15989
+ self.assertRaises(OverflowError, pollster.register, 0,
+ _testcapi.SHRT_MAX + 1)
+ self.assertRaises(OverflowError, pollster.register, 0,
+ _testcapi.USHRT_MAX + 1)
+ self.assertRaises(OverflowError, pollster.poll, _testcapi.INT_MAX + 1)
+ self.assertRaises(OverflowError, pollster.poll, _testcapi.UINT_MAX + 1)
+
def test_main():
run_unittest(PollTests)