MCPcopy Index your code
hub / github.com/python/cpython / store_raise_exc_generator

Method store_raise_exc_generator

Lib/test/test_generators.py:414–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 3

assertIsNoneMethod · 0.80
assertIsInstanceMethod · 0.80
exceptionMethod · 0.45

Tested by

no test coverage detected