(self)
| 248 | |
| 249 | @unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII') |
| 250 | def test_coding(self): |
| 251 | # bpo-32381: the -c command ignores the coding cookie |
| 252 | ch = os_helper.FS_NONASCII |
| 253 | cmd = f"# coding: latin1\nprint(ascii('{ch}'))" |
| 254 | res = assert_python_ok('-c', cmd) |
| 255 | self.assertEqual(res.out.rstrip(), ascii(ch).encode('ascii')) |
| 256 | |
| 257 | # On Windows, pass bytes to subprocess doesn't test how Python decodes the |
| 258 | # command line, but how subprocess does decode bytes to unicode. Python |
nothing calls this directly
no test coverage detected