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

Method test_open_code

Lib/test/test_io/test_fileio.py:761–771  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

759 open = _pyio.open
760
761 def test_open_code(self):
762 # Check that the default behaviour of open_code matches
763 # open("rb")
764 with self.FileIO(__file__, "rb") as f:
765 expected = f.read()
766 with check_warnings(quiet=True) as w:
767 # Always test _open_code_with_warning
768 with _pyio._open_code_with_warning(__file__) as f:
769 actual = f.read()
770 self.assertEqual(expected, actual)
771 self.assertNotEqual(w.warnings, [])
772
773
774def tearDownModule():

Callers

nothing calls this directly

Calls 4

check_warningsFunction · 0.90
assertNotEqualMethod · 0.80
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected