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

Method test_open_w

Lib/test/test_pathlib/test_write.py:32–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30 self.assertIsInstance(self.root, _WritablePath)
31
32 def test_open_w(self):
33 p = self.root / 'fileA'
34 with magic_open(p, 'w', encoding='utf-8') as f:
35 self.assertIsInstance(f, io.TextIOBase)
36 f.write('this is file A\n')
37 self.assertEqual(self.ground.readtext(p), 'this is file A\n')
38
39 @unittest.skipIf(
40 not getattr(sys.flags, 'warn_default_encoding', 0),

Callers

nothing calls this directly

Calls 5

magic_openFunction · 0.90
assertIsInstanceMethod · 0.80
writeMethod · 0.45
assertEqualMethod · 0.45
readtextMethod · 0.45

Tested by

no test coverage detected