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

Method assert_class_defs_same

Lib/test/test_crossinterp.py:571–588  ·  view source on GitHub ↗
(self, defs)

Source from the content-addressed store, hash-verified

569 # classes
570
571 def assert_class_defs_same(self, defs):
572 # Unpickle relative to the unchanged original module.
573 self.assert_roundtrip_identical(defs.TOP_CLASSES)
574
575 instances = []
576 for cls, args in defs.TOP_CLASSES.items():
577 if cls in defs.CLASSES_WITHOUT_EQUALITY:
578 continue
579 instances.append(cls(*args))
580 self.assert_roundtrip_equal_not_identical(instances)
581
582 # these don't compare equal
583 instances = []
584 for cls, args in defs.TOP_CLASSES.items():
585 if cls not in defs.CLASSES_WITHOUT_EQUALITY:
586 continue
587 instances.append(cls(*args))
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.

Callers 3

Calls 6

clsClass · 0.50
itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected