| 688 | def test_destructor(self): |
| 689 | record = [] |
| 690 | class MyFileIO(self.FileIO): |
| 691 | def __del__(self): |
| 692 | record.append(1) |
| 693 | try: |
| 694 | f = super().__del__ |
| 695 | except AttributeError: |
| 696 | pass |
| 697 | else: |
| 698 | f() |
| 699 | def close(self): |
| 700 | record.append(2) |
| 701 | super().close() |
| 702 | def flush(self): |
| 703 | record.append(3) |
| 704 | super().flush() |
| 705 | with warnings_helper.check_warnings(('', ResourceWarning)): |
| 706 | f = MyFileIO(os_helper.TESTFN, "wb") |
| 707 | f.write(b"xxx") |
no outgoing calls