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

Method test_gh_115618

Lib/test/test_property.py:187–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

185
186 @support.refcount_test
187 def test_gh_115618(self):
188 # Py_XDECREF() was improperly called for None argument
189 # in property methods.
190 gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')
191 prop = property()
192 refs_before = gettotalrefcount()
193 for i in range(100):
194 prop = prop.getter(None)
195 self.assertIsNone(prop.fget)
196 for i in range(100):
197 prop = prop.setter(None)
198 self.assertIsNone(prop.fset)
199 for i in range(100):
200 prop = prop.deleter(None)
201 self.assertIsNone(prop.fdel)
202 self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10)
203
204 def test_property_name(self):
205 def getter(self):

Callers

nothing calls this directly

Calls 6

propertyClass · 0.85
assertIsNoneMethod · 0.80
deleterMethod · 0.80
getterMethod · 0.45
setterMethod · 0.45
assertAlmostEqualMethod · 0.45

Tested by

no test coverage detected