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

Method test_load_attr_class

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

Source from the content-addressed store, hash-verified

770
771 @requires_specialization
772 def test_load_attr_class(self):
773 def get_items():
774 class C:
775 a = make_deferred_ref_count_obj()
776
777 items = []
778 for _ in range(self.ITEMS):
779 item = C
780 items.append(item)
781 return items
782
783 def read(items):
784 for item in items:
785 try:
786 item.a
787 except AttributeError:
788 pass
789
790 def write(items):
791 for item in items:
792 try:
793 del item.a
794 except AttributeError:
795 pass
796 item.a = make_deferred_ref_count_obj()
797
798 opname = "LOAD_ATTR_CLASS"
799 self.assert_races_do_not_crash(opname, get_items, read, write)
800
801 @requires_specialization
802 def test_load_attr_class_with_metaclass_check(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected