summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-17 09:49:17 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-17 09:49:17 (GMT)
commit0c2fd897772984994c49bec1325e77c04f81cf20 (patch)
tree00bb808ad11533a0b56f63ad091186f2a7510509 /Lib
parente010d8f031f0b2e29dd95db61769c524d59a74d2 (diff)
downloadcpython-0c2fd897772984994c49bec1325e77c04f81cf20.zip
cpython-0c2fd897772984994c49bec1325e77c04f81cf20.tar.gz
cpython-0c2fd897772984994c49bec1325e77c04f81cf20.tar.bz2
Revert changeset d927047b1d8eb87738676980a24930d053ba2150
Sorry, it was a mistake, the patch is still under review: issue #23646.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/eintrdata/eintr_tester.py17
-rw-r--r--Lib/test/test_signal.py17
2 files changed, 8 insertions, 26 deletions
diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py
index 8547576..40dca84 100644
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -252,23 +252,8 @@ 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,
- TimeEINTRTest)
+ support.run_unittest(OSEINTRTest, SocketEINTRTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 6ecff9e..774fc80 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -419,20 +419,17 @@ class WakeupSignalTests(unittest.TestCase):
TIMEOUT_HALF = 5
signal.alarm(1)
-
+ before_time = time.time()
# We attempt to get a signal during the sleep,
# before select is called
- try:
- select.select([], [], [], TIMEOUT_FULL)
- except InterruptedError:
- pass
- else:
- raise Exception("select() was not interrupted")
-
- before_time = time.time()
+ time.sleep(TIMEOUT_FULL)
+ mid_time = time.time()
+ dt = mid_time - before_time
+ if dt >= TIMEOUT_HALF:
+ raise Exception("%s >= %s" % (dt, TIMEOUT_HALF))
select.select([read], [], [], TIMEOUT_FULL)
after_time = time.time()
- dt = after_time - before_time
+ dt = after_time - mid_time
if dt >= TIMEOUT_HALF:
raise Exception("%s >= %s" % (dt, TIMEOUT_HALF))
""", signal.SIGALRM)