is_future() only accepts 'real' futures, but NullFutures work here, too.
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)
+ assert all(is_future(i) or isinstance(i, _NullFuture) for i in children)
unfinished_children = set(children)
future = _create_future()
# now that it's not a real Future
@gen.coroutine
def wait_a_moment():
- yield gen.multi([gen.moment, gen.moment])
+ result = yield gen.multi([gen.moment, gen.moment])
+ raise gen.Return(result)
loop = self.get_new_ioloop()
- loop.run_sync(wait_a_moment)
+ result = loop.run_sync(wait_a_moment)
+ self.assertEqual(result, [None, None])
if __name__ == '__main__':