(self)
| 486 | memio.write(b'x') |
| 487 | |
| 488 | def test_getbuffer_gc_collect(self): |
| 489 | memio = self.ioclass(b"1234567890") |
| 490 | buf = memio.getbuffer() |
| 491 | memiowr = weakref.ref(memio) |
| 492 | bufwr = weakref.ref(buf) |
| 493 | # Create a reference loop. |
| 494 | a = [buf] |
| 495 | a.append(a) |
| 496 | # The Python implementation emits an unraisable exception. |
| 497 | with support.catch_unraisable_exception(): |
| 498 | del memio |
| 499 | del buf |
| 500 | del a |
| 501 | # The C implementation emits an unraisable exception. |
| 502 | with support.catch_unraisable_exception(): |
| 503 | gc.collect() |
| 504 | self.assertIsNone(memiowr()) |
| 505 | self.assertIsNone(bufwr()) |
| 506 | |
| 507 | def test_read1(self): |
| 508 | buf = self.buftype("1234567890") |
nothing calls this directly
no test coverage detected