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

Method test_load_attr_module

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

Source from the content-addressed store, hash-verified

978
979 @requires_specialization
980 def test_load_attr_module(self):
981 def get_items():
982 items = []
983 for _ in range(self.ITEMS):
984 item = types.ModuleType("<item>")
985 items.append(item)
986 return items
987
988 def read(items):
989 for item in items:
990 try:
991 item.__name__
992 except AttributeError:
993 pass
994
995 def write(items):
996 for item in items:
997 d = item.__dict__.copy()
998 item.__dict__.clear()
999 item.__dict__.update(d)
1000
1001 opname = "LOAD_ATTR_MODULE"
1002 self.assert_races_do_not_crash(opname, get_items, read, write)
1003
1004 @requires_specialization
1005 def test_load_attr_property(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected