bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)

This commit is contained in:
Yury Selivanov 2018-10-02 13:53:06 -04:00 committed by GitHub
parent 11c4eaa993
commit 9012a0fb4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 192 additions and 206 deletions

View file

@ -271,7 +271,7 @@ class EventLoopTestsMixin:
def test_run_until_complete(self):
t0 = self.loop.time()
self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop))
self.loop.run_until_complete(asyncio.sleep(0.1))
t1 = self.loop.time()
self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
@ -279,7 +279,7 @@ class EventLoopTestsMixin:
async def cb():
self.loop.stop()
await asyncio.sleep(0.1, loop=self.loop)
await asyncio.sleep(0.1)
task = cb()
self.assertRaises(RuntimeError,
self.loop.run_until_complete, task)
@ -1757,11 +1757,11 @@ class EventLoopTestsMixin:
async def wait():
loop = self.loop
await asyncio.sleep(1e-2, loop=loop)
await asyncio.sleep(1e-4, loop=loop)
await asyncio.sleep(1e-6, loop=loop)
await asyncio.sleep(1e-8, loop=loop)
await asyncio.sleep(1e-10, loop=loop)
await asyncio.sleep(1e-2)
await asyncio.sleep(1e-4)
await asyncio.sleep(1e-6)
await asyncio.sleep(1e-8)
await asyncio.sleep(1e-10)
self.loop.run_until_complete(wait())
# The ideal number of call is 12, but on some platforms, the selector