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

Method test_proxy_unicode

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

Source from the content-addressed store, hash-verified

326 self.assertEqual(L3[2:5], p3[2:5])
327
328 def test_proxy_unicode(self):
329 # See bug 5037
330 class C(object):
331 def __str__(self):
332 return "string"
333 def __bytes__(self):
334 return b"bytes"
335 instance = C()
336 self.assertIn("__bytes__", dir(weakref.proxy(instance)))
337 self.assertEqual(bytes(weakref.proxy(instance)), b"bytes")
338
339 def test_proxy_index(self):
340 class C:

Callers

nothing calls this directly

Calls 4

assertInMethod · 0.80
proxyMethod · 0.80
CClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected