Check that a generator-based coroutine completes and return its value.
(self, gen)
| 81 | next(gen) |
| 82 | |
| 83 | def assertGeneratorReturns(self, gen): |
| 84 | """ |
| 85 | Check that a generator-based coroutine completes and return its value. |
| 86 | |
| 87 | """ |
| 88 | with self.assertRaises(StopIteration) as raised: |
| 89 | next(gen) |
| 90 | return raised.exception.value |
| 91 | |
| 92 | |
| 93 | class DeprecationTestCase(unittest.TestCase): |
no outgoing calls