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

Method test_clear_managed_dict

Lib/test/test_capi/test_misc.py:886–898  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

884 self.assertHasAttr(ctypes.pythonapi, name)
885
886 def test_clear_managed_dict(self):
887
888 class C:
889 def __init__(self):
890 self.a = 1
891
892 c = C()
893 _testcapi.clear_managed_dict(c)
894 self.assertEqual(c.__dict__, {})
895 c = C()
896 self.assertEqual(c.__dict__, {'a':1})
897 _testcapi.clear_managed_dict(c)
898 self.assertEqual(c.__dict__, {})
899
900 def test_unstable_gc_new_with_extra_data(self):
901 class Data(_testcapi.ObjExtraData):

Callers

nothing calls this directly

Calls 2

CClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected