summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_faulthandler.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-04 21:42:30 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-04 21:42:30 (GMT)
commit9bdb43e43f9f5d80699e297c2f73c106179b33d5 (patch)
treebd252e2f5cec3a9b3b455a18089a2f7e1c57ba5e /Lib/test/test_faulthandler.py
parent2d3222740bd119df048b955facd30eb48953b05f (diff)
downloadcpython-9bdb43e43f9f5d80699e297c2f73c106179b33d5.zip
cpython-9bdb43e43f9f5d80699e297c2f73c106179b33d5.tar.gz
cpython-9bdb43e43f9f5d80699e297c2f73c106179b33d5.tar.bz2
Issue #11765: don't test time.sleep() in test_faulthandler
time.time() and/or time.sleep() are not accurate on Windows, don't test them in test_faulthandler. Anyway, the check was written for an old implementation of dump_tracebacks_later(), it is not more needed.
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r--Lib/test/test_faulthandler.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 4158d86..59a0a6d 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -360,16 +360,8 @@ import time
def func(repeat, cancel, timeout):
if cancel:
faulthandler.cancel_dump_tracebacks_later()
-
- pause = timeout * 2.5
- # on Windows XP, b-a gives 1.249931 after sleep(1.25)
- min_pause = pause * 0.9
- a = time.time()
- time.sleep(pause)
- b = time.time()
+ time.sleep(timeout * 2.5)
faulthandler.cancel_dump_tracebacks_later()
- # Check that sleep() was not interrupted
- assert (b - a) >= min_pause, "{{}} < {{}}".format(b - a, min_pause)
timeout = {timeout}
repeat = {repeat}
@@ -400,7 +392,7 @@ if file is not None:
else:
count = 1
header = 'Thread 0x[0-9a-f]+:\n'
- regex = expected_traceback(12, 27, header, count=count)
+ regex = expected_traceback(7, 19, header, count=count)
self.assertRegex(trace, regex)
else:
self.assertEqual(trace, '')