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

Method test_io

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected