[Python-checkins] cpython (3.3): Issue #20101: Allow test_monotonic to pass on Windows machines on which

zach.ware python-checkins at python.org
Thu Jan 2 16:43:31 CET 2014


http://hg.python.org/cpython/rev/82df66a091da
changeset:   88254:82df66a091da
branch:      3.3
parent:      88250:0daf7f02c97f
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Thu Jan 02 09:41:10 2014 -0600
summary:
  Issue #20101: Allow test_monotonic to pass on Windows machines on which
time.get_clock_info('monotonic').resolution == 0.015600099999999999

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

files:
  Lib/test/test_time.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -376,7 +376,8 @@
         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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list