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

Method test_open_code

Lib/test/test_fileio.py:762–772  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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