mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
test: update test_unicode_file
This commit is contained in:
1 parent
323cf44788
commit
c15971f18a
1 file changed
+4
-5
Vendored
+4
-5
@@ -2,16 +2,17 @@
|
||||
# We don't test many operations on files other than
|
||||
# that their names can be used with Unicode characters.
|
||||
import os, glob, time, shutil
|
||||
import sys
|
||||
import unicodedata
|
||||
|
||||
import unittest
|
||||
from test.support import run_unittest
|
||||
from test.support.os_helper import (rmtree, change_cwd, TESTFN_UNICODE,
|
||||
TESTFN_UNENCODABLE, create_empty_file)
|
||||
|
||||
|
||||
if not os.path.supports_unicode_filenames:
|
||||
try:
|
||||
TESTFN_UNICODE.encode(TESTFN_ENCODING)
|
||||
TESTFN_UNICODE.encode(sys.getfilesystemencoding())
|
||||
except (UnicodeError, TypeError):
|
||||
# Either the file system encoding is None, or the file name
|
||||
# cannot be encoded in the file system encoding.
|
||||
@@ -134,8 +135,6 @@ class TestUnicodeFiles(unittest.TestCase):
|
||||
self._do_directory(TESTFN_UNENCODABLE+ext,
|
||||
TESTFN_UNENCODABLE+ext)
|
||||
|
||||
def test_main():
|
||||
run_unittest(__name__)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user