(self)
| 2145 | self.assertEqual(res, [199]) |
| 2146 | |
| 2147 | def test_arg_errors(self): |
| 2148 | def fin(*args, **kwargs): |
| 2149 | res.append((args, kwargs)) |
| 2150 | |
| 2151 | a = self.A() |
| 2152 | |
| 2153 | res = [] |
| 2154 | f = weakref.finalize(a, fin, 1, 2, func=3, obj=4) |
| 2155 | self.assertEqual(f.peek(), (a, fin, (1, 2), {'func': 3, 'obj': 4})) |
| 2156 | f() |
| 2157 | self.assertEqual(res, [((1, 2), {'func': 3, 'obj': 4})]) |
| 2158 | |
| 2159 | with self.assertRaises(TypeError): |
| 2160 | weakref.finalize(a, func=fin, arg=1) |
| 2161 | with self.assertRaises(TypeError): |
| 2162 | weakref.finalize(obj=a, func=fin, arg=1) |
| 2163 | self.assertRaises(TypeError, weakref.finalize, a) |
| 2164 | self.assertRaises(TypeError, weakref.finalize) |
| 2165 | |
| 2166 | def test_order(self): |
| 2167 | a = self.A() |
nothing calls this directly
no test coverage detected