Skip to content

Commit c15971f

Browse files
committed
test: update test_unicode_file
1 parent 323cf44 commit c15971f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_unicode_file.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
# We don't test many operations on files other than
33
# that their names can be used with Unicode characters.
44
import os, glob, time, shutil
5+
import sys
56
import unicodedata
67

78
import unittest
8-
from test.support import run_unittest
99
from test.support.os_helper import (rmtree, change_cwd, TESTFN_UNICODE,
1010
TESTFN_UNENCODABLE, create_empty_file)
1111

12+
1213
if not os.path.supports_unicode_filenames:
1314
try:
14-
TESTFN_UNICODE.encode(TESTFN_ENCODING)
15+
TESTFN_UNICODE.encode(sys.getfilesystemencoding())
1516
except (UnicodeError, TypeError):
1617
# Either the file system encoding is None, or the file name
1718
# cannot be encoded in the file system encoding.
@@ -134,8 +135,6 @@ def test_directories(self):
134135
self._do_directory(TESTFN_UNENCODABLE+ext,
135136
TESTFN_UNENCODABLE+ext)
136137

137-
def test_main():
138-
run_unittest(__name__)
139138

140139
if __name__ == "__main__":
141-
test_main()
140+
unittest.main()

0 commit comments

Comments
 (0)