MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_weakref

Method test_weakref

Lib/test/test_functools.py:179–185  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177 self.assertRaises(ZeroDivisionError, self.partial(f, y=0), 1)
178
179 def test_weakref(self):
180 f = self.partial(int, base=16)
181 p = proxy(f)
182 self.assertEqual(f.func, p.func)
183 f = None
184 support.gc_collect() # For PyPy or other GCs.
185 self.assertRaises(ReferenceError, getattr, p, 'func')
186
187 def test_with_bound_and_unbound_methods(self):
188 data = list(map(str, range(10)))

Callers

nothing calls this directly

Calls 4

proxyFunction · 0.90
partialMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected