|
8 | 8 | import shutil
|
9 | 9 | from collections import namedtuple
|
10 | 10 |
|
11 |
| -import test.support |
| 11 | +from test import support |
12 | 12 | from test.support.script_helper import (
|
13 | 13 | run_python_until_end,
|
14 | 14 | interpreter_requires_environment,
|
|
27 | 27 |
|
28 | 28 | # Apply some platform dependent overrides
|
29 | 29 | if sys.platform.startswith("linux"):
|
30 |
| - if test.support.is_android: |
| 30 | + if support.is_android: |
31 | 31 | # Android defaults to using UTF-8 for all system interfaces
|
32 | 32 | EXPECTED_C_LOCALE_STREAM_ENCODING = "utf-8"
|
33 | 33 | EXPECTED_C_LOCALE_FS_ENCODING = "utf-8"
|
@@ -203,6 +203,15 @@ def setUpModule():
|
203 | 203 | CLI_COERCION_TARGET = AVAILABLE_TARGETS[0]
|
204 | 204 | CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET)
|
205 | 205 |
|
| 206 | + if support.verbose: |
| 207 | + print(f"AVAILABLE_TARGETS = {AVAILABLE_TARGETS!r}") |
| 208 | + print(f"EXPECTED_C_LOCALE_EQUIVALENTS = {EXPECTED_C_LOCALE_EQUIVALENTS!r}") |
| 209 | + print(f"EXPECTED_C_LOCALE_STREAM_ENCODING = {EXPECTED_C_LOCALE_STREAM_ENCODING!r}") |
| 210 | + print(f"EXPECTED_C_LOCALE_FS_ENCODING = {EXPECTED_C_LOCALE_FS_ENCODING!r}") |
| 211 | + print(f"EXPECT_COERCION_IN_DEFAULT_LOCALE = {EXPECT_COERCION_IN_DEFAULT_LOCALE!r}") |
| 212 | + print(f"_C_UTF8_LOCALES = {_C_UTF8_LOCALES!r}") |
| 213 | + print(f"_check_nl_langinfo_CODESET = {_check_nl_langinfo_CODESET!r}") |
| 214 | + |
206 | 215 |
|
207 | 216 | class _LocaleHandlingTestCase(unittest.TestCase):
|
208 | 217 | # Base class to check expected locale handling behaviour
|
@@ -279,7 +288,7 @@ def test_external_target_locale_configuration(self):
|
279 | 288 |
|
280 | 289 |
|
281 | 290 |
|
282 |
| -@test.support.cpython_only |
| 291 | +@support.cpython_only |
283 | 292 | @unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"),
|
284 | 293 | "C locale coercion disabled at build time")
|
285 | 294 | class LocaleCoercionTests(_LocaleHandlingTestCase):
|
@@ -335,7 +344,7 @@ def _check_c_locale_coercion(self,
|
335 | 344 | # locale environment variables are undefined or empty. When
|
336 | 345 | # this code path is run with environ['LC_ALL'] == 'C', then
|
337 | 346 | # LEGACY_LOCALE_WARNING is printed.
|
338 |
| - if (test.support.is_android and |
| 347 | + if (support.is_android and |
339 | 348 | _expected_warnings == [CLI_COERCION_WARNING]):
|
340 | 349 | _expected_warnings = None
|
341 | 350 | self._check_child_encoding_details(base_var_dict,
|
@@ -405,11 +414,11 @@ def test_LC_ALL_set_to_C(self):
|
405 | 414 | coercion_expected=False)
|
406 | 415 |
|
407 | 416 | def test_main():
|
408 |
| - test.support.run_unittest( |
| 417 | + support.run_unittest( |
409 | 418 | LocaleConfigurationTests,
|
410 | 419 | LocaleCoercionTests
|
411 | 420 | )
|
412 |
| - test.support.reap_children() |
| 421 | + support.reap_children() |
413 | 422 |
|
414 | 423 | if __name__ == "__main__":
|
415 | 424 | test_main()
|
0 commit comments