From: Victor Stinner Date: Mon, 16 Dec 2013 21:38:46 +0000 (+0100) Subject: (Merge 3.3) Close #19999: tolerate coarse time when testing time.monotonic() on X-Git-Tag: v3.4.0b2~198 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4275b276c14d0de21fb8e9210dcf302c6dd5fd8;p=python (Merge 3.3) Close #19999: tolerate coarse time when testing time.monotonic() on very busy/slow buildbot --- a4275b276c14d0de21fb8e9210dcf302c6dd5fd8 diff --cc Lib/test/test_time.py index 048cb3b6d7,6b7a4fb768..bc5f69e031 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@@ -384,9 -376,8 +384,9 @@@ class TimeTestCase(unittest.TestCase) t2 = time.monotonic() dt = t2 - t1 self.assertGreater(t2, t1) - self.assertAlmostEqual(dt, 0.5, delta=0.2) + self.assertTrue(0.5 <= dt <= 1.0, dt) + # monotonic() is a monotonic but non adjustable clock info = time.get_clock_info('monotonic') self.assertTrue(info.monotonic) self.assertFalse(info.adjustable)