summaryrefslogtreecommitdiffstats
path: root/Lib/test/eintrdata
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-12 15:19:01 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-12 15:19:01 (GMT)
commit945c82eea3072b41c09dd7c9cdc75a1f24e0ce59 (patch)
treeb4b9df22ef99c26908dc9d1003f74325a4d5d9fd /Lib/test/eintrdata
parentf7cc3fccadae5f2bb764b16808806b7d1849871b (diff)
downloadcpython-945c82eea3072b41c09dd7c9cdc75a1f24e0ce59.zip
cpython-945c82eea3072b41c09dd7c9cdc75a1f24e0ce59.tar.gz
cpython-945c82eea3072b41c09dd7c9cdc75a1f24e0ce59.tar.bz2
test
Diffstat (limited to 'Lib/test/eintrdata')
-rw-r--r--Lib/test/eintrdata/eintr_tester.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py
index 40dca84..8547576 100644
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -252,8 +252,23 @@ class SocketEINTRTest(EINTRBaseTest):
lambda path: os.close(os.open(path, os.O_WRONLY)))
+@unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
+class TimeEINTRTest(EINTRBaseTest):
+ """ EINTR tests for the time module. """
+
+ def test_sleep(self):
+ t0 = time.monotonic()
+ time.sleep(2)
+ signal.alarm(0)
+ dt = time.monotonic() - t0
+ self.assertGreaterEqual(dt, 1.9)
+
+
def test_main():
- support.run_unittest(OSEINTRTest, SocketEINTRTest)
+ support.run_unittest(
+ OSEINTRTest,
+ SocketEINTRTest,
+ TimeEINTRTest)
if __name__ == "__main__":