Hi,

While testing Trollius on Python 2.6, I noticed a new test which uses
the syntax for set literal (see below). It looks like the test is
wrong: it should test duplicated coroutines, but it pass a set to
as_completed(): the duplicated are removed during the creation of the
set ...

    def test_as_completed_duplicate_coroutines(self):
        @asyncio.coroutine
        def coro(s):
            return s

        @asyncio.coroutine
        def runner():
            result = []
            c = coro('ham')
            for f in asyncio.as_completed({c, c, coro('spam')}, loop=self.loop):
                result.append((yield from f))
            return result

        fut = asyncio.Task(runner(), loop=self.loop)
        self.loop.run_until_complete(fut)
        result = fut.result()
        self.assertEqual(set(result), {'ham', 'spam'})
        self.assertEqual(len(result), 2)

Victor

Reply via email to