(self)
| 2162 | self.assertEqual(res, [199]) |
| 2163 | |
| 2164 | def test_arg_errors(self): |
| 2165 | def fin(*args, **kwargs): |
| 2166 | res.append((args, kwargs)) |
| 2167 | |
| 2168 | a = self.A() |
| 2169 | |
| 2170 | res = [] |
| 2171 | f = weakref.finalize(a, fin, 1, 2, func=3, obj=4) |
| 2172 | self.assertEqual(f.peek(), (a, fin, (1, 2), {'func': 3, 'obj': 4})) |
| 2173 | f() |
| 2174 | self.assertEqual(res, [((1, 2), {'func': 3, 'obj': 4})]) |
| 2175 | |
| 2176 | with self.assertRaises(TypeError): |
| 2177 | weakref.finalize(a, func=fin, arg=1) |
| 2178 | with self.assertRaises(TypeError): |
| 2179 | weakref.finalize(obj=a, func=fin, arg=1) |
| 2180 | self.assertRaises(TypeError, weakref.finalize, a) |
| 2181 | self.assertRaises(TypeError, weakref.finalize) |
| 2182 | |
| 2183 | def test_order(self): |
| 2184 | a = self.A() |
nothing calls this directly
no test coverage detected