MCPcopy Index your code
hub / github.com/RustPython/RustPython / MyFileIO

Class MyFileIO

Lib/test/test_io.py:690–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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")

Callers 1

test_destructorMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_destructorMethod · 0.56