]> granicus.if.org Git - python/commitdiff
Issue #14428: Make test_process_time_threads() less strict
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Apr 2012 22:51:31 +0000 (00:51 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Apr 2012 22:51:31 +0000 (00:51 +0200)
Lib/test/test_time.py

index 85f8c526a84a1fbe865cf247a0b65f5553eca0ce..435e0a45cb3d23f6d9cfd219e643e5e37e830a21 100644 (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')