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

Method assert_class_defs_other_pickle

Lib/test/test_crossinterp.py:590–599  ·  view source on GitHub ↗
(self, defs, mod)

Source from the content-addressed store, hash-verified

588 self.assert_roundtrip_equal(instances)
589
590 def assert_class_defs_other_pickle(self, defs, mod):
591 # Pickle relative to a different module than the original.
592 for cls in defs.TOP_CLASSES:
593 assert not hasattr(mod, cls.__name__), (cls, getattr(mod, cls.__name__))
594 self.assert_not_shareable(defs.TOP_CLASSES)
595
596 instances = []
597 for cls, args in defs.TOP_CLASSES.items():
598 instances.append(cls(*args))
599 self.assert_not_shareable(instances)
600
601 def assert_class_defs_other_unpickle(self, defs, mod, *, fail=False):
602 # Unpickle relative to a different module than the original.

Callers

nothing calls this directly

Calls 4

assert_not_shareableMethod · 0.80
clsClass · 0.50
itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected