MCPcopy Index your code
hub / github.com/python/cpython / MyFileIO

Class MyFileIO

Lib/test/test_io/test_general.py:385–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

test_destructorMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_destructorMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…