()
| 412 | |
| 413 | def test_except_throw(self): |
| 414 | def store_raise_exc_generator(): |
| 415 | try: |
| 416 | self.assertIsNone(sys.exception()) |
| 417 | yield |
| 418 | except Exception as exc: |
| 419 | # exception raised by gen.throw(exc) |
| 420 | self.assertIsInstance(sys.exception(), ValueError) |
| 421 | self.assertIsNone(exc.__context__) |
| 422 | yield |
| 423 | |
| 424 | # ensure that the exception is not lost |
| 425 | self.assertIsInstance(sys.exception(), ValueError) |
| 426 | yield |
| 427 | |
| 428 | # we should be able to raise back the ValueError |
| 429 | raise |
| 430 | |
| 431 | make = store_raise_exc_generator() |
| 432 | next(make) |
nothing calls this directly
no test coverage detected