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

Method test_destructor

Lib/test/test_io.py:3139–3151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3137 self.assertEqual(buf.getvalue(), expected)
3138
3139 def test_destructor(self):
3140 l = []
3141 base = self.BytesIO
3142 class MyBytesIO(base):
3143 def close(self):
3144 l.append(self.getvalue())
3145 base.close(self)
3146 b = MyBytesIO()
3147 t = self.TextIOWrapper(b, encoding="ascii")
3148 t.write("abc")
3149 del t
3150 support.gc_collect()
3151 self.assertEqual([b"abc"], l)
3152
3153 def test_override_destructor(self):
3154 record = []

Callers

nothing calls this directly

Calls 3

writeMethod · 0.95
MyBytesIOClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected