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

Method test_coding

Lib/test/test_cmd_line.py:214–219  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212
213 @unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII')
214 def test_coding(self):
215 # bpo-32381: the -c command ignores the coding cookie
216 ch = os_helper.FS_NONASCII
217 cmd = f"# coding: latin1\nprint(ascii('{ch}'))"
218 res = assert_python_ok('-c', cmd)
219 self.assertEqual(res.out.rstrip(), ascii(ch).encode('ascii'))
220
221 # On Windows, pass bytes to subprocess doesn't test how Python decodes the
222 # command line, but how subprocess does decode bytes to unicode. Python

Callers

nothing calls this directly

Calls 5

assert_python_okFunction · 0.90
asciiFunction · 0.85
assertEqualMethod · 0.45
rstripMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected