| 383 | def test_destructor(self): |
| 384 | record = [] |
| 385 | class MyFileIO(self.FileIO): |
| 386 | def __del__(self): |
| 387 | record.append(1) |
| 388 | try: |
| 389 | f = super().__del__ |
| 390 | except AttributeError: |
| 391 | pass |
| 392 | else: |
| 393 | f() |
| 394 | def close(self): |
| 395 | record.append(2) |
| 396 | super().close() |
| 397 | def flush(self): |
| 398 | record.append(3) |
| 399 | super().flush() |
| 400 | with warnings_helper.check_warnings(('', ResourceWarning)): |
| 401 | f = MyFileIO(os_helper.TESTFN, "wb") |
| 402 | f.write(b"xxx") |
no outgoing calls
searching dependent graphs…