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

Method test_io

Lib/test/test_utf8_mode.py:160–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158 'stderr: utf-8/backslashreplace'])
159
160 def test_io(self):
161 code = textwrap.dedent('''
162 import sys
163 filename = sys.argv[1]
164 with open(filename) as fp:
165 print(f"{fp.encoding}/{fp.errors}")
166 ''')
167 filename = __file__
168
169 out = self.get_output('-c', code, filename, PYTHONUTF8='1')
170 self.assertEqual(out.lower(), 'utf-8/strict')
171
172 def _check_io_encoding(self, module, encoding=None, errors=None):
173 filename = __file__

Callers

nothing calls this directly

Calls 4

get_outputMethod · 0.95
dedentMethod · 0.80
assertEqualMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected