summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2013-11-21 10:02:29 -0800
committerGuido van Rossum <guido@python.org>2013-11-21 10:02:29 -0800
commitf954462412cd482a2d24c7ee35b8ecc9b1133940 (patch)
treebcec1ed2ea5ea96871ae379d374420d83c879b91 /tests
parentf2c6d5a40ce3e7ebc90b6f103527b9d6b9d47376 (diff)
downloadtrollius-f954462412cd482a2d24c7ee35b8ecc9b1133940.tar.gz
Allow and correctly implement Semaphore(0).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_locks.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_locks.py b/tests/test_locks.py
index 19ef877..539c5c3 100644
--- a/tests/test_locks.py
+++ b/tests/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]>'))