(self)
| 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 |
nothing calls this directly
no test coverage detected