Created
November 3, 2012 12:30
-
-
Save asvetlov/4007236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_non_utf8(self): | |
# Issue #16218 | |
with temp_dir() as script_dir: | |
script_basename = '\u0441\u043a\u0440\u0438\u043f\u0442' | |
try: | |
script_basename.encode(sys.getfilesystemencoding()) | |
except UnicodeEncodeError: | |
raise unittest.SkipTest("Filesystem doesn't support " | |
"unicode names") | |
source = 'print("test output")\n' | |
script_name = make_script(script_dir, script_basename, source) | |
importlib.invalidate_caches() | |
if not __debug__: | |
run_args = ('-' + 'O' * sys.flags.optimize, script_name) | |
else: | |
run_args = (script_name,) | |
rc, out, _ = assert_python_ok(*run_args) | |
self.assertEqual(0, rc) | |
self.assertEqual(b"test output\n", out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment