Commit 655d0d27 authored by Denis Bilenko's avatar Denis Bilenko

add a test case for JoinableQueue(0) bug (fixed in 549:539aefe864c8)

parent 218cb230
...@@ -227,6 +227,16 @@ class TestChannel(TestCase): ...@@ -227,6 +227,16 @@ class TestChannel(TestCase):
self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world', 'sent world'], events) self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world', 'sent world'], events)
g.get() g.get()
def test_task_done(self):
channel = queue.JoinableQueue(0)
X = object()
gevent.spawn(channel.put, X)
result = channel.get()
assert result is X, (result, X)
assert channel.unfinished_tasks == 1, channel.unfinished_tasks
channel.task_done()
assert channel.unfinished_tasks == 0, channel.unfinished_tasks
class TestNoWait(TestCase): class TestNoWait(TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment