@with_in_memory_connection
    def test_gather(self, conn):
        def collect_replies():
            yield 1
            yield 2
            yield 3

        ticket = uuid()
        actor = Actor(conn)
        actor._collect_replies = Mock(return_value=collect_replies())

        ares = AsyncResult(ticket, actor)
        ares.to_python = Mock()

        all = ares.gather()
        list(all)

        actor._collect_replies.assert_caleld_once_with(conn, ANY, ticket)
        self.assertEqual(ares.to_python.call_count,
                         len(list(collect_replies())))

        # test that the to_python is applied to all results
        actor._collect_replies.reset_mock()
        actor._collect_replies = Mock(return_value=collect_replies())
        prev_to_python = ares.to_python
        new_to_python = lambda x, propagate = True: 'called_%s' % x
        ares.to_python = new_to_python

        all = ares.gather()
        vals = list(all)

        expected_vals = [new_to_python(i) for i in collect_replies()]

        actor._collect_replies.assert_caleld_once_with(conn, ANY, ticket)
        self.assertEqual(vals, expected_vals)
        ares.to_python = prev_to_python

        # test kwargs
dataset/ETHPy150Open celery/cell/cell/tests/actors/test_results.py/test_AsyncResuls.test_gather/original