diff options
Diffstat (limited to 'Lib/test/test_asyncio/test_pep492.py')
-rw-r--r-- | Lib/test/test_asyncio/test_pep492.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index a1f27dd..c5e3a5c 100644 --- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -77,13 +77,12 @@ class LockTests(BaseTest): async def test(lock): await asyncio.sleep(0.01) self.assertFalse(lock.locked()) - with self.assertWarns(DeprecationWarning): - with await lock as _lock: - self.assertIs(_lock, None) - self.assertTrue(lock.locked()) - await asyncio.sleep(0.01) - self.assertTrue(lock.locked()) - self.assertFalse(lock.locked()) + with self.assertRaisesRegex( + TypeError, + "can't be used in 'await' expression" + ): + with await lock: + pass for primitive in primitives: self.loop.run_until_complete(test(primitive)) |