PATH: //opt/alt/python311/lib64/python3.11/distutils/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
π Setup.sample
β
X
π __init__.py
β
X
π __pycache__/
X
π includetest.rst
β
X
π support.py
β
X
π test_archive_util.py
β
X
π test_bdist.py
β
X
π test_bdist_dumb.py
β
X
π test_bdist_rpm.py
β
X
π test_build.py
β
X
π test_build_clib.py
β
X
π test_build_ext.py
β
X
π test_build_py.py
β
X
π test_build_scripts.py
β
X
π test_check.py
β
X
π test_clean.py
β
X
π test_cmd.py
β
X
π test_config.py
β
X
π test_config_cmd.py
β
X
π test_core.py
β
X
π test_cygwinccompiler.py
β
X
π test_dep_util.py
β
X
π test_dir_util.py
β
X
π test_dist.py
β
X
π test_extension.py
β
X
π test_file_util.py
β
X
π test_filelist.py
β
X
π test_install.py
β
X
π test_install_data.py
β
X
π test_install_headers.py
β
X
π test_install_lib.py
β
X
π test_install_scripts.py
β
X
π test_log.py
β
X
π test_msvc9compiler.py
β
X
π test_msvccompiler.py
β
X
π test_register.py
β
X
π test_sdist.py
β
X
π test_spawn.py
β
X
π test_sysconfig.py
β
X
π test_text_file.py
β
X
π test_unixccompiler.py
β
X
π test_upload.py
β
X
π test_util.py
β
X
π test_version.py
β
X
π test_versionpredicate.py
β
X
π xxmodule.c
β
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_log.py
"""Tests for distutils.log""" import io import sys import unittest from test.support import swap_attr from distutils import log class TestLog(unittest.TestCase): def test_non_ascii(self): # Issues #8663, #34421: test that non-encodable text is escaped with # backslashreplace error handler and encodable non-ASCII text is # output as is. for errors in ('strict', 'backslashreplace', 'surrogateescape', 'replace', 'ignore'): with self.subTest(errors=errors): stdout = io.TextIOWrapper(io.BytesIO(), encoding='cp437', errors=errors) stderr = io.TextIOWrapper(io.BytesIO(), encoding='cp437', errors=errors) old_threshold = log.set_threshold(log.DEBUG) try: with swap_attr(sys, 'stdout', stdout), \ swap_attr(sys, 'stderr', stderr): log.debug('DΞ΅bug\tMΔssΓ£ge') log.fatal('FΞ±tal\tΓrrΕr') finally: log.set_threshold(old_threshold) stdout.seek(0) self.assertEqual(stdout.read().rstrip(), 'DΞ΅bug\tM?ss?ge' if errors == 'replace' else 'DΞ΅bug\tMssge' if errors == 'ignore' else 'DΞ΅bug\tM\\u0117ss\\xe3ge') stderr.seek(0) self.assertEqual(stderr.read().rstrip(), 'FΞ±tal\t?rr?r' if errors == 'replace' else 'FΞ±tal\trrr' if errors == 'ignore' else 'FΞ±tal\t\\xc8rr\\u014dr') if __name__ == "__main__": unittest.main()
SIMPAN PERUBAHAN