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

Method test_for_iter_gen

Lib/test/test_opcache.py:718–747  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

716
717 @requires_specialization
718 def test_for_iter_gen(self):
719 def get_items():
720 def g():
721 yield
722 yield
723
724 items = []
725 for _ in range(self.ITEMS):
726 item = g()
727 items.append(item)
728 return items
729
730 def read(items):
731 for item in items:
732 try:
733 for _ in item:
734 break
735 except ValueError:
736 pass
737
738 def write(items):
739 for item in items:
740 try:
741 for _ in item:
742 break
743 except ValueError:
744 pass
745
746 opname = "FOR_ITER_GEN"
747 self.assert_races_do_not_crash(opname, get_items, read, write)
748
749 @requires_specialization
750 def test_for_iter_list(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected