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

Method test_closefd_attr

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

Source from the content-addressed store, hash-verified

797 encoding="utf-8", closefd=False)
798
799 def test_closefd_attr(self):
800 with self.open(os_helper.TESTFN, "wb") as f:
801 f.write(b"egg\n")
802 with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f:
803 self.assertEqual(f.buffer.raw.closefd, True)
804 file = self.open(f.fileno(), "r", encoding="utf-8", closefd=False)
805 self.assertEqual(file.buffer.raw.closefd, False)
806
807 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: filter ('', ResourceWarning) did not catch any warning
808 @unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; cyclic GC not supported, causes file locking")

Callers

nothing calls this directly

Calls 4

openMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
filenoMethod · 0.45

Tested by

no test coverage detected