def assertGeneratorReturns(self, gen):
    '\n        Check that a generator-based coroutine completes and return its value.\n\n        '
    with self.assertRaises(StopIteration) as raised:
        next(gen)
    return raised.exception.value
Check that a generator-based coroutine completes and return its value.
def assertGeneratorReturns(self, gen):
    '\n        \n\n        '
    with self.assertRaises(StopIteration) as raised:
        next(gen)
    return raised.exception.value