summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_locks.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-11-21 19:07:45 (GMT)
committerGuido van Rossum <guido@dropbox.com>2013-11-21 19:07:45 (GMT)
commit9c55a58a1d7f664e7d236ef690d17409841632c4 (patch)
tree6c8ad2caefedc542eaebed256d83eec2a5dde545 /Lib/test/test_asyncio/test_locks.py
parentd88c6f9b9bae5aecdcedecf9185aff9a31bf6c4f (diff)
downloadcpython-9c55a58a1d7f664e7d236ef690d17409841632c4.zip
cpython-9c55a58a1d7f664e7d236ef690d17409841632c4.tar.gz
cpython-9c55a58a1d7f664e7d236ef690d17409841632c4.tar.bz2
asyncio: Make Semaphore(0) work properly.
Diffstat (limited to 'Lib/test/test_asyncio/test_locks.py')
-rw-r--r--Lib/test/test_asyncio/test_locks.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index 19ef877..539c5c3 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -684,6 +684,10 @@ class SemaphoreTests(unittest.TestCase):
finally:
events.set_event_loop(None)
+ def test_initial_value_zero(self):
+ sem = locks.Semaphore(0, loop=self.loop)
+ self.assertTrue(sem.locked())
+
def test_repr(self):
sem = locks.Semaphore(loop=self.loop)
self.assertTrue(repr(sem).endswith('[unlocked,value:1]>'))