summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_queues.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-02-17 21:53:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-02-17 21:53:28 (GMT)
commit4cb814c7e1840b9e4d479cc43e65b6fff451ae90 (patch)
treeb27eb5e2697f3e606bf7403c33ad33ea94574753 /Lib/test/test_asyncio/test_queues.py
parent4e82fb99a0b5128abefaf433a56ab1fa48b9a848 (diff)
downloadcpython-4cb814c7e1840b9e4d479cc43e65b6fff451ae90.zip
cpython-4cb814c7e1840b9e4d479cc43e65b6fff451ae90.tar.gz
cpython-4cb814c7e1840b9e4d479cc43e65b6fff451ae90.tar.bz2
asyncio, Tulip issue 220: Merge JoinableQueue with Queue.
Merge JoinableQueue with Queue. To more closely match the standard Queue, asyncio.Queue has "join" and "task_done". JoinableQueue is deleted. Docstring for Queue.join shouldn't mention threads. Restore JoinableQueue as a deprecated alias for Queue. To more closely match the standard Queue, asyncio.Queue has "join" and "task_done". JoinableQueue remains as a deprecated alias for Queue to avoid needlessly breaking too much code that depended on it. Patch written by A. Jesse Jiryu Davis <jesse@mongodb.com>.
Diffstat (limited to 'Lib/test/test_asyncio/test_queues.py')
-rw-r--r--Lib/test/test_asyncio/test_queues.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_queues.py b/Lib/test/test_asyncio/test_queues.py
index 3d4ac51..a73539d 100644
--- a/Lib/test/test_asyncio/test_queues.py
+++ b/Lib/test/test_asyncio/test_queues.py
@@ -408,14 +408,14 @@ class PriorityQueueTests(_QueueTestBase):
self.assertEqual([1, 2, 3], items)
-class JoinableQueueTests(_QueueTestBase):
+class QueueJoinTests(_QueueTestBase):
def test_task_done_underflow(self):
- q = asyncio.JoinableQueue(loop=self.loop)
+ q = asyncio.Queue(loop=self.loop)
self.assertRaises(ValueError, q.task_done)
def test_task_done(self):
- q = asyncio.JoinableQueue(loop=self.loop)
+ q = asyncio.Queue(loop=self.loop)
for i in range(100):
q.put_nowait(i)
@@ -452,7 +452,7 @@ class JoinableQueueTests(_QueueTestBase):
self.loop.run_until_complete(asyncio.wait(tasks, loop=self.loop))
def test_join_empty_queue(self):
- q = asyncio.JoinableQueue(loop=self.loop)
+ q = asyncio.Queue(loop=self.loop)
# Test that a queue join()s successfully, and before anything else
# (done twice for insurance).
@@ -465,7 +465,7 @@ class JoinableQueueTests(_QueueTestBase):
self.loop.run_until_complete(join())
def test_format(self):
- q = asyncio.JoinableQueue(loop=self.loop)
+ q = asyncio.Queue(loop=self.loop)
self.assertEqual(q._format(), 'maxsize=0')
q._unfinished_tasks = 2