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

Method test_method

Lib/test/test_gc.py:166–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 self.assertEqual(gc.collect(), 0)
165
166 def test_method(self):
167 # Tricky: self.__init__ is a bound method, it references the instance.
168 class A:
169 def __init__(self):
170 self.init = self.__init__
171 a = A()
172 gc.collect()
173 del a
174 self.assertNotEqual(gc.collect(), 0)
175
176 @cpython_only
177 def test_legacy_finalizer(self):

Callers

nothing calls this directly

Calls 3

assertNotEqualMethod · 0.80
AClass · 0.70
collectMethod · 0.45

Tested by

no test coverage detected