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

Method test_copy_inst_getinitargs

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

Source from the content-addressed store, hash-verified

186 self.assertEqual(copy.copy(x), x)
187
188 def test_copy_inst_getinitargs(self):
189 class C:
190 def __init__(self, foo):
191 self.foo = foo
192 def __getinitargs__(self):
193 return (self.foo,)
194 def __eq__(self, other):
195 return self.foo == other.foo
196 x = C(42)
197 self.assertEqual(copy.copy(x), x)
198
199 def test_copy_inst_getnewargs(self):
200 class C(int):

Callers

nothing calls this directly

Calls 3

CClass · 0.70
assertEqualMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected