mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)
This commit is contained in:
parent
11c4eaa993
commit
9012a0fb4c
14 changed files with 192 additions and 206 deletions
|
@ -81,13 +81,13 @@ class LockTests(test_utils.TestCase):
|
|||
|
||||
@asyncio.coroutine
|
||||
def test(lock):
|
||||
yield from asyncio.sleep(0.01, loop=loop)
|
||||
yield from asyncio.sleep(0.01)
|
||||
self.assertFalse(lock.locked())
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
with (yield from lock) as _lock:
|
||||
self.assertIs(_lock, None)
|
||||
self.assertTrue(lock.locked())
|
||||
yield from asyncio.sleep(0.01, loop=loop)
|
||||
yield from asyncio.sleep(0.01)
|
||||
self.assertTrue(lock.locked())
|
||||
self.assertFalse(lock.locked())
|
||||
|
||||
|
@ -819,8 +819,7 @@ class ConditionTests(test_utils.TestCase):
|
|||
condition = asyncio.Condition(loop=loop)
|
||||
async with condition:
|
||||
with self.assertRaises(asyncio.TimeoutError):
|
||||
await asyncio.wait_for(condition.wait(), timeout=0.5,
|
||||
loop=loop)
|
||||
await asyncio.wait_for(condition.wait(), timeout=0.5)
|
||||
|
||||
loop.run_until_complete(task_timeout())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue