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

Method test_empty_yield_from

Lib/test/test_ast/test_ast.py:605–611  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

603 compile(e, "<test>", "eval")
604
605 def test_empty_yield_from(self):
606 # Issue 16546: yield from value is not optional.
607 empty_yield_from = ast.parse("def f():\n yield from g()")
608 empty_yield_from.body[0].body[0].value.value = None
609 with self.assertRaises(ValueError) as cm:
610 compile(empty_yield_from, "<test>", "exec")
611 self.assertIn("field 'value' is required", str(cm.exception))
612
613 @support.cpython_only
614 def test_issue31592(self):

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
assertInMethod · 0.80
compileFunction · 0.50
parseMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected