(self)
| 214 | self.assertEqual(y.foo, x.foo) |
| 215 | |
| 216 | def test_copy_inst_getnewargs_ex(self): |
| 217 | class C(int): |
| 218 | def __new__(cls, *, foo): |
| 219 | self = int.__new__(cls) |
| 220 | self.foo = foo |
| 221 | return self |
| 222 | def __getnewargs_ex__(self): |
| 223 | return (), {'foo': self.foo} |
| 224 | def __eq__(self, other): |
| 225 | return self.foo == other.foo |
| 226 | x = C(foo=42) |
| 227 | y = copy.copy(x) |
| 228 | self.assertIsInstance(y, C) |
| 229 | self.assertEqual(y, x) |
| 230 | self.assertIsNot(y, x) |
| 231 | self.assertEqual(y.foo, x.foo) |
| 232 | |
| 233 | def test_copy_inst_getstate(self): |
| 234 | class C: |
nothing calls this directly
no test coverage detected