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

Method test_locale_getpreferredencoding

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

Source from the content-addressed store, hash-verified

200 self.check_io_encoding('_pyio')
201
202 def test_locale_getpreferredencoding(self):
203 code = 'import locale; print(locale.getpreferredencoding(False), locale.getpreferredencoding(True))'
204 out = self.get_output('-X', 'utf8', '-c', code)
205 self.assertEqual(out, 'utf-8 utf-8')
206
207 for loc in POSIX_LOCALES:
208 with self.subTest(LC_ALL=loc):
209 out = self.get_output('-X', 'utf8', '-c', code, LC_ALL=loc)
210 self.assertEqual(out, 'utf-8 utf-8')
211
212 @unittest.skipIf(MS_WINDOWS, 'test specific to Unix')
213 def test_cmd_line(self):

Callers

nothing calls this directly

Calls 3

get_outputMethod · 0.95
assertEqualMethod · 0.45
subTestMethod · 0.45

Tested by

no test coverage detected