(self)
| 180 | self.check_basic_callback(create_cfunction) |
| 181 | |
| 182 | def test_multiple_callbacks(self): |
| 183 | o = C() |
| 184 | ref1 = weakref.ref(o, self.callback) |
| 185 | ref2 = weakref.ref(o, self.callback) |
| 186 | del o |
| 187 | gc_collect() # For PyPy or other GCs. |
| 188 | self.assertIsNone(ref1(), "expected reference to be invalidated") |
| 189 | self.assertIsNone(ref2(), "expected reference to be invalidated") |
| 190 | self.assertEqual(self.cbcalled, 2, |
| 191 | "callback not called the right number of times") |
| 192 | |
| 193 | def test_multiple_selfref_callbacks(self): |
| 194 | # Make sure all references are invalidated before callbacks are called |
nothing calls this directly
no test coverage detected