(self, makeref)
| 386 | self.check_shared_without_callback(weakref.proxy) |
| 387 | |
| 388 | def check_shared_without_callback(self, makeref): |
| 389 | o = Object(1) |
| 390 | p1 = makeref(o, None) |
| 391 | p2 = makeref(o, None) |
| 392 | self.assertIs(p1, p2, "both callbacks were None in the C API") |
| 393 | del p1, p2 |
| 394 | p1 = makeref(o) |
| 395 | p2 = makeref(o, None) |
| 396 | self.assertIs(p1, p2, "callbacks were NULL, None in the C API") |
| 397 | del p1, p2 |
| 398 | p1 = makeref(o) |
| 399 | p2 = makeref(o) |
| 400 | self.assertIs(p1, p2, "both callbacks were NULL in the C API") |
| 401 | del p1, p2 |
| 402 | p1 = makeref(o, None) |
| 403 | p2 = makeref(o) |
| 404 | self.assertIs(p1, p2, "callbacks were None, NULL in the C API") |
| 405 | |
| 406 | def test_callable_proxy(self): |
| 407 | o = Callable() |
no test coverage detected