summaryrefslogtreecommitdiffstats
path: root/Lib/test/eintrdata/eintr_tester.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/eintrdata/eintr_tester.py')
-rw-r--r--Lib/test/eintrdata/eintr_tester.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py
index ba056fb..82cef83 100644
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -10,6 +10,7 @@ sub-second periodicity (contrarily to signal()).
import io
import os
+import select
import signal
import socket
import time
@@ -303,12 +304,25 @@ class SignalEINTRTest(EINTRBaseTest):
self.assertGreaterEqual(dt, self.sleep_time)
+@unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
+class SelectEINTRTest(EINTRBaseTest):
+ """ EINTR tests for the select module. """
+
+ def test_select(self):
+ t0 = time.monotonic()
+ select.select([], [], [], self.sleep_time)
+ signal.alarm(0)
+ dt = time.monotonic() - t0
+ self.assertGreaterEqual(dt, self.sleep_time)
+
+
def test_main():
support.run_unittest(
OSEINTRTest,
SocketEINTRTest,
TimeEINTRTest,
- SignalEINTRTest)
+ SignalEINTRTest,
+ SelectEINTRTest)
if __name__ == "__main__":