(self)
| 191 | self.assertEqual(copy.copy(x), x) |
| 192 | |
| 193 | def test_copy_inst_getnewargs(self): |
| 194 | class C(int): |
| 195 | def __new__(cls, foo): |
| 196 | self = int.__new__(cls) |
| 197 | self.foo = foo |
| 198 | return self |
| 199 | def __getnewargs__(self): |
| 200 | return self.foo, |
| 201 | def __eq__(self, other): |
| 202 | return self.foo == other.foo |
| 203 | x = C(42) |
| 204 | y = copy.copy(x) |
| 205 | self.assertIsInstance(y, C) |
| 206 | self.assertEqual(y, x) |
| 207 | self.assertIsNot(y, x) |
| 208 | self.assertEqual(y.foo, x.foo) |
| 209 | |
| 210 | def test_copy_inst_getnewargs_ex(self): |
| 211 | class C(int): |
nothing calls this directly
no test coverage detected