asyncio: Relax timing requirement. Fixes issue 19579.

This commit is contained in:
Guido van Rossum 2013-11-13 20:17:52 -08:00
parent c6ae813011
commit 8ff3e8af72
1 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class BaseEventLoopTests(unittest.TestCase):
f.cancel() # Don't complain about abandoned Future. f.cancel() # Don't complain about abandoned Future.
def test__run_once(self): def test__run_once(self):
h1 = events.TimerHandle(time.monotonic() + 0.1, lambda: True, ()) h1 = events.TimerHandle(time.monotonic() + 5.0, lambda: True, ())
h2 = events.TimerHandle(time.monotonic() + 10.0, lambda: True, ()) h2 = events.TimerHandle(time.monotonic() + 10.0, lambda: True, ())
h1.cancel() h1.cancel()
@ -181,7 +181,7 @@ class BaseEventLoopTests(unittest.TestCase):
self.loop._run_once() self.loop._run_once()
t = self.loop._selector.select.call_args[0][0] t = self.loop._selector.select.call_args[0][0]
self.assertTrue(9.99 < t < 10.1, t) self.assertTrue(9.9 < t < 10.1, t)
self.assertEqual([h2], self.loop._scheduled) self.assertEqual([h2], self.loop._scheduled)
self.assertTrue(self.loop._process_events.called) self.assertTrue(self.loop._process_events.called)