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

Method test_open_r

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

Source from the content-addressed store, hash-verified

31 self.assertIsInstance(self.root, _ReadablePath)
32
33 def test_open_r(self):
34 p = self.root / 'fileA'
35 with vfsopen(p, 'r', encoding='utf-8') as f:
36 self.assertIsInstance(f, io.TextIOBase)
37 self.assertEqual(f.read(), 'this is file A\n')
38
39 def test_open_r_buffering_error(self):
40 p = self.root / 'fileA'

Callers

nothing calls this directly

Calls 4

vfsopenFunction · 0.90
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected