]> granicus.if.org Git - python/commitdiff
(Merge 3.3) Close #19999: tolerate coarse time when testing time.monotonic() on
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Dec 2013 21:38:46 +0000 (22:38 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Dec 2013 21:38:46 +0000 (22:38 +0100)
very busy/slow buildbot

1  2 
Lib/test/test_time.py

index 048cb3b6d77d05e67a590c9c432c4d656f307343,6b7a4fb7686ec2451832954e2962e421d89cfde4..bc5f69e03127731dcee2fdcae1becba6885f7723
@@@ -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)