summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_locks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_locks.py')
-rw-r--r--Lib/test/test_asyncio/test_locks.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index 8ad1486..c4e74e3 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -656,6 +656,18 @@ class ConditionTests(test_utils.TestCase):
self.assertFalse(cond.locked())
+ def test_explicit_lock(self):
+ lock = asyncio.Lock(loop=self.loop)
+ cond = asyncio.Condition(lock, loop=self.loop)
+
+ self.assertIs(lock._loop, cond._loop)
+
+ def test_ambiguous_loops(self):
+ loop = self.new_test_loop()
+ lock = asyncio.Lock(loop=self.loop)
+ with self.assertRaises(ValueError):
+ asyncio.Condition(lock, loop=loop)
+
class SemaphoreTests(test_utils.TestCase):