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

Method test_copy_inst_getstate

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

Source from the content-addressed store, hash-verified

231 self.assertEqual(y.foo, x.foo)
232
233 def test_copy_inst_getstate(self):
234 class C:
235 def __init__(self, foo):
236 self.foo = foo
237 def __getstate__(self):
238 return {"foo": self.foo}
239 def __eq__(self, other):
240 return self.foo == other.foo
241 x = C(42)
242 self.assertEqual(copy.copy(x), x)
243
244 def test_copy_inst_setstate(self):
245 class C:

Callers

nothing calls this directly

Calls 3

CClass · 0.70
assertEqualMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected