MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_proxy_div

Method test_proxy_div

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

proxyMethod · 0.80
CClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected