Issue #14428: Make test_process_time_threads() less strict

This commit is contained in:
Victor Stinner 2012-04-30 00:51:31 +02:00
parent 934cb18ef5
commit 5df72c2c27

View file

@ -438,7 +438,8 @@ class TimeTestCase(unittest.TestCase):
t2 = time.process_time()
thread.stop = True
thread.join()
self.assertGreaterEqual(t2 - t1, busy)
# Use a factor of 0.75 because time.process_time() is maybe not precise
self.assertGreaterEqual(t2 - t1, busy * 0.75)
@unittest.skipUnless(hasattr(time, 'monotonic'),
'need time.monotonic')