(self)
| 237 | check('utf8=0', [c_arg], LC_ALL=loc) |
| 238 | |
| 239 | def test_optim_level(self): |
| 240 | # CPython: check that Py_Main() doesn't increment Py_OptimizeFlag |
| 241 | # twice when -X utf8 requires to parse the configuration twice (when |
| 242 | # the encoding changes after reading the configuration, the |
| 243 | # configuration is read again with the new encoding). |
| 244 | code = 'import sys; print(sys.flags.optimize)' |
| 245 | out = self.get_output('-X', 'utf8', '-O', '-c', code) |
| 246 | self.assertEqual(out, '1') |
| 247 | out = self.get_output('-X', 'utf8', '-OO', '-c', code) |
| 248 | self.assertEqual(out, '2') |
| 249 | |
| 250 | code = 'import sys; print(sys.flags.ignore_environment)' |
| 251 | out = self.get_output('-X', 'utf8', '-E', '-c', code) |
| 252 | self.assertEqual(out, '1') |
| 253 | |
| 254 | @unittest.skipIf(MS_WINDOWS, |
| 255 | "os.device_encoding() doesn't implement " |
nothing calls this directly
no test coverage detected