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

Method test_cycle_through_dict

Lib/test/test_descr.py:5214–5227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5212 self.assertRaises(TypeError, type, 'Foo', (), ns)
5213
5214 def test_cycle_through_dict(self):
5215 # See bug #1469629
5216 class X(dict):
5217 def __init__(self):
5218 dict.__init__(self)
5219 self.__dict__ = self
5220 x = X()
5221 x.attr = 42
5222 wr = weakref.ref(x)
5223 del x
5224 support.gc_collect()
5225 self.assertIsNone(wr())
5226 for o in gc.get_objects():
5227 self.assertIsNot(type(o), X)
5228
5229 def test_object_new_and_init_with_parameters(self):
5230 # See issue #1683368

Callers

nothing calls this directly

Calls 3

assertIsNoneMethod · 0.80
assertIsNotMethod · 0.80
XClass · 0.70

Tested by

no test coverage detected