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

Method test_copy_inst_copy

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

Source from the content-addressed store, hash-verified

175 self.assertEqual(copy.copy(x), x)
176
177 def test_copy_inst_copy(self):
178 class C:
179 def __init__(self, foo):
180 self.foo = foo
181 def __copy__(self):
182 return C(self.foo)
183 def __eq__(self, other):
184 return self.foo == other.foo
185 x = C(42)
186 self.assertEqual(copy.copy(x), x)
187
188 def test_copy_inst_getinitargs(self):
189 class C:

Callers

nothing calls this directly

Calls 3

CClass · 0.70
assertEqualMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected