def test_put_cancelled(self):
    q = asyncio.Queue(loop=self.loop)

    @asyncio.coroutine
    def queue_put():
        (yield from q.put(1))
        return True

    @asyncio.coroutine
    def test():
        return (yield from q.get())
    t = asyncio.Task(queue_put(), loop=self.loop)
    self.assertEqual(1, self.loop.run_until_complete(test()))
    self.assertTrue(t.done())
    self.assertTrue(t.result())
def test_put_cancelled(self):
    q = asyncio.Queue(loop=self.loop)

    @asyncio.coroutine
    def queue_put():
        (yield from q.put(1))
        return True

    @asyncio.coroutine
    def test():
        return (yield from q.get())
    t = asyncio.Task(queue_put(), loop=self.loop)
    self.assertEqual(1, self.loop.run_until_complete(test()))
    self.assertTrue(t.done())
    self.assertTrue(t.result())