summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_time.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-06-01 20:45:23 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-06-01 20:45:23 (GMT)
commit0dec1bfef98eff72540601fa081b17c33572895d (patch)
tree42da889b53a6b30abdc476fbd1a027c1aed76f1a /Lib/test/test_time.py
parent5a0d4391265824de4af3a0dbf473e0b1b493bbba (diff)
downloadcpython-0dec1bfef98eff72540601fa081b17c33572895d.zip
cpython-0dec1bfef98eff72540601fa081b17c33572895d.tar.gz
cpython-0dec1bfef98eff72540601fa081b17c33572895d.tar.bz2
Fix sporadic failure of test_time.test_process_time() on Windows
Use a threshold of 20 ms instead of 10 ms.
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r--Lib/test/test_time.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index c8ce158..02f05c3 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -380,10 +380,13 @@ class TimeTestCase(unittest.TestCase):
time.perf_counter()
def test_process_time(self):
+ # process_time() should not include time spend during a sleep
start = time.process_time()
- time.sleep(0.1)
+ time.sleep(0.100)
stop = time.process_time()
- self.assertLess(stop - start, 0.01)
+ # use 20 ms because process_time() has usually a resolution of 15 ms
+ # on Windows
+ self.assertLess(stop - start, 0.020)
info = time.get_clock_info('process_time')
self.assertTrue(info.monotonic)