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

Method test_copy_reduce_ex

Lib/test/test_copy.py:58–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 self.assertEqual(y.foo, x.foo)
57
58 def test_copy_reduce_ex(self):
59 class C(object):
60 def __reduce_ex__(self, proto):
61 c.append(1)
62 return ""
63 def __reduce__(self):
64 self.fail("shouldn't call this")
65 c = []
66 x = C()
67 y = copy.copy(x)
68 self.assertIs(y, x)
69 self.assertEqual(c, [1])
70
71 def test_copy_reduce(self):
72 class C(object):

Callers

nothing calls this directly

Calls 4

CClass · 0.70
copyMethod · 0.45
assertIsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected