summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_pep492.py
diff options
context:
space:
mode:
authorEmmanuel Arias <emmanuelarias30@gmail.com>2019-09-10 10:55:07 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-10 10:55:07 (GMT)
commit537877d85d1c27d2c2f5189e39da64a7a0c413d3 (patch)
tree44b52523924c0c5496ceba24ffbe0b6ba95e569f /Lib/test/test_asyncio/test_pep492.py
parent9669931e5e76cf4b6ae6d3d66e699b5fd6ffe931 (diff)
downloadcpython-537877d85d1c27d2c2f5189e39da64a7a0c413d3.zip
cpython-537877d85d1c27d2c2f5189e39da64a7a0c413d3.tar.gz
cpython-537877d85d1c27d2c2f5189e39da64a7a0c413d3.tar.bz2
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [locks] (GH-13920)
This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Third step: locks.py https://bugs.python.org/issue36373
Diffstat (limited to 'Lib/test/test_asyncio/test_pep492.py')
-rw-r--r--Lib/test/test_asyncio/test_pep492.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py
index a5cf37d..f327bbd 100644
--- a/Lib/test/test_asyncio/test_pep492.py
+++ b/Lib/test/test_asyncio/test_pep492.py
@@ -43,12 +43,13 @@ class BaseTest(test_utils.TestCase):
class LockTests(BaseTest):
def test_context_manager_async_with(self):
- primitives = [
- asyncio.Lock(loop=self.loop),
- asyncio.Condition(loop=self.loop),
- asyncio.Semaphore(loop=self.loop),
- asyncio.BoundedSemaphore(loop=self.loop),
- ]
+ with self.assertWarns(DeprecationWarning):
+ primitives = [
+ asyncio.Lock(loop=self.loop),
+ asyncio.Condition(loop=self.loop),
+ asyncio.Semaphore(loop=self.loop),
+ asyncio.BoundedSemaphore(loop=self.loop),
+ ]
async def test(lock):
await asyncio.sleep(0.01)
@@ -65,12 +66,13 @@ class LockTests(BaseTest):
self.assertFalse(primitive.locked())
def test_context_manager_with_await(self):
- primitives = [
- asyncio.Lock(loop=self.loop),
- asyncio.Condition(loop=self.loop),
- asyncio.Semaphore(loop=self.loop),
- asyncio.BoundedSemaphore(loop=self.loop),
- ]
+ with self.assertWarns(DeprecationWarning):
+ primitives = [
+ asyncio.Lock(loop=self.loop),
+ asyncio.Condition(loop=self.loop),
+ asyncio.Semaphore(loop=self.loop),
+ asyncio.BoundedSemaphore(loop=self.loop),
+ ]
async def test(lock):
await asyncio.sleep(0.01)