MCPcopy Index your code
hub / github.com/python/cpython / 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 vfsopen(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 def test_open_w_buffering_error(self):
40 p = self.root / 'fileA'

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected