@unittest.skipIf((sys.version_info < (3, 6, 4)), 'Changed in 3.6.4')
def test_cancelled_getters_not_being_held_in_self_getters(self):

    def a_generator():
        (yield 0.1)
        (yield 0.2)
    self.loop = self.new_test_loop(a_generator)

    @asyncio.coroutine
    def consumer(queue):
        try:
            (yield from asyncio.wait_for(queue.get(), 0.1, loop=self.loop))
        except asyncio.TimeoutError:
            pass
    queue = asyncio.Queue(loop=self.loop, maxsize=5)
    self.loop.run_until_complete(self.loop.create_task(consumer(queue)))
    self.assertEqual(len(queue._getters), 0)
@unittest.skipIf((sys.version_info < (3, 6, 4)), 'Changed in 3.6.4')
def test_cancelled_getters_not_being_held_in_self_getters(self):

    def a_generator():
        (yield 0.1)
        (yield 0.2)
    self.loop = self.new_test_loop(a_generator)

    @asyncio.coroutine
    def consumer(queue):
        try:
            (yield from asyncio.wait_for(queue.get(), 0.1, loop=self.loop))
        except asyncio.TimeoutError:
            pass
    queue = asyncio.Queue(loop=self.loop, maxsize=5)
    self.loop.run_until_complete(self.loop.create_task(consumer(queue)))
    self.assertEqual(len(queue._getters), 0)