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

Method test_copy_copy

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

Source from the content-addressed store, hash-verified

29 self.assertEqual(x, y)
30
31 def test_copy_copy(self):
32 class C(object):
33 def __init__(self, foo):
34 self.foo = foo
35 def __copy__(self):
36 return C(self.foo)
37 x = C(42)
38 y = copy.copy(x)
39 self.assertEqual(y.__class__, x.__class__)
40 self.assertEqual(y.foo, x.foo)
41
42 def test_copy_registry(self):
43 class C(object):

Callers

nothing calls this directly

Calls 3

CClass · 0.70
copyMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected