]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #20101: Allow test_monotonic to pass on Windows machines on which
authorZachary Ware <zachary.ware@gmail.com>
Thu, 2 Jan 2014 15:41:10 +0000 (09:41 -0600)
committerZachary Ware <zachary.ware@gmail.com>
Thu, 2 Jan 2014 15:41:10 +0000 (09:41 -0600)
time.get_clock_info('monotonic').resolution == 0.015600099999999999

This is just a workaround pending a real resolution to #20101.

Lib/test/test_time.py

index 6b7a4fb7686ec2451832954e2962e421d89cfde4..ae3113a04afb236bc5e74eedb023c73119820ad5 100644 (file)
@@ -376,7 +376,8 @@ class TimeTestCase(unittest.TestCase):
         t2 = time.monotonic()
         dt = t2 - t1
         self.assertGreater(t2, t1)
-        self.assertTrue(0.5 <= dt <= 1.0, dt)
+        # Issue #20101: On some Windows machines, dt may be slightly low
+        self.assertTrue(0.45 <= dt <= 1.0, dt)
 
         info = time.get_clock_info('monotonic')
         self.assertTrue(info.monotonic)