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

Method test_except_next

Lib/test/test_generators.py:449–459  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

447 self.assertIsNone(sys.exception())
448
449 def test_except_next(self):
450 def gen():
451 self.assertIsInstance(sys.exception(), ValueError)
452 yield "done"
453
454 g = gen()
455 try:
456 raise ValueError
457 except Exception:
458 self.assertEqual(next(g), "done")
459 self.assertIsNone(sys.exception())
460
461 def test_except_gen_except(self):
462 def gen():

Callers

nothing calls this directly

Calls 4

assertIsNoneMethod · 0.80
genFunction · 0.70
assertEqualMethod · 0.45
exceptionMethod · 0.45

Tested by

no test coverage detected