summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r--Lib/test/test_asyncio/test_events.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index f22cb5e..3ee6565 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -293,10 +293,11 @@ class EventLoopTestsMixin:
# 15.6 msec, we use fairly long sleep times here (~100 msec).
def test_run_until_complete(self):
+ delay = 0.100
t0 = self.loop.time()
- self.loop.run_until_complete(asyncio.sleep(0.1))
- t1 = self.loop.time()
- self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
+ self.loop.run_until_complete(asyncio.sleep(delay))
+ dt = self.loop.time() - t0
+ self.assertGreaterEqual(dt, delay - test_utils.CLOCK_RES)
def test_run_until_complete_stopped(self):
@@ -1717,7 +1718,6 @@ class EventLoopTestsMixin:
self.loop._run_once = _run_once
async def wait():
- loop = self.loop
await asyncio.sleep(1e-2)
await asyncio.sleep(1e-4)
await asyncio.sleep(1e-6)