From 9bdb43e43f9f5d80699e297c2f73c106179b33d5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 4 Apr 2011 23:42:30 +0200 Subject: [PATCH] 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. --- Lib/test/test_faulthandler.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 4158d864aa6..59a0a6d8dad 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, '')