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

Method test_proxy_div

Lib/test/test_weakref.py:347–357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

345 self.assertEqual(operator.index(p), 10)
346
347 def test_proxy_div(self):
348 class C:
349 def __floordiv__(self, other):
350 return 42
351 def __ifloordiv__(self, other):
352 return 21
353 o = C()
354 p = weakref.proxy(o)
355 self.assertEqual(p // 5, 42)
356 p //= 5
357 self.assertEqual(p, 21)
358
359 def test_proxy_matmul(self):
360 class C:

Callers

nothing calls this directly

Calls 3

proxyMethod · 0.80
CClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected