mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
test_time.test_monotonic(): use a longer sleep to try to make the test more reliable
This commit is contained in:
parent
330426cfe2
commit
a9c99a6119
1 changed files with 2 additions and 2 deletions
|
@ -368,11 +368,11 @@ class TimeTestCase(unittest.TestCase):
|
||||||
'need time.monotonic')
|
'need time.monotonic')
|
||||||
def test_monotonic(self):
|
def test_monotonic(self):
|
||||||
t1 = time.monotonic()
|
t1 = time.monotonic()
|
||||||
time.sleep(0.1)
|
time.sleep(0.5)
|
||||||
t2 = time.monotonic()
|
t2 = time.monotonic()
|
||||||
dt = t2 - t1
|
dt = t2 - t1
|
||||||
self.assertGreater(t2, t1)
|
self.assertGreater(t2, t1)
|
||||||
self.assertAlmostEqual(dt, 0.1, delta=0.2)
|
self.assertAlmostEqual(dt, 0.5, delta=0.2)
|
||||||
|
|
||||||
info = time.get_clock_info('monotonic')
|
info = time.get_clock_info('monotonic')
|
||||||
self.assertTrue(info.monotonic)
|
self.assertTrue(info.monotonic)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue