fixes assertion in gen.multi when calling convert_yielded with more than one gen.moment or None
convert_yielded can be called with None or [None].
When it is called with [None], gen.multi gets [gen.moment],
which fails assert(is_future) since it is no longer a real Future
else:
keys = None
children = list(map(convert_yielded, children))
+ # filter out NullFutures, like gen.moment
+ children = [child for child in children
+ if not isinstance(child, _NullFuture)]
assert all(is_future(i) for i in children)
unfinished_children = set(children)
# coroutine finalizer was called (not on PyPy3 apparently)
self.assertIs(result[-1], None)
+ def test_multi_moment(self):
+ # Test gen.multi with moment
+ # now that it's not a real Future
+ @gen.coroutine
+ def wait_a_moment():
+ yield gen.multi([gen.moment, gen.moment])
+
+ loop = self.get_new_ioloop()
+ loop.run_sync(wait_a_moment)
+
if __name__ == '__main__':
unittest.main()