summaryrefslogtreecommitdiff
path: root/Lib/test/test_importlib/fixtures.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-06-07 10:57:45 -0400
committerGitHub <noreply@github.com>2020-06-07 10:57:45 -0400
commit2efe18bf277dd0f38a1d248ae6bdd30947c26880 (patch)
treeae3a827bca4fe68fa1263e9d11f3dec72223b2fb /Lib/test/test_importlib/fixtures.py
parent47a23fc63fa5df2da8dbc542e78e521d4a7f10c9 (diff)
downloadcpython-git-2efe18bf277dd0f38a1d248ae6bdd30947c26880.tar.gz
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (#20681)
Diffstat (limited to 'Lib/test/test_importlib/fixtures.py')
-rw-r--r--Lib/test/test_importlib/fixtures.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py
index b25febb7fe..2e55d14b9a 100644
--- a/Lib/test/test_importlib/fixtures.py
+++ b/Lib/test/test_importlib/fixtures.py
@@ -210,6 +210,17 @@ def build_files(file_defs, prefix=pathlib.Path()):
f.write(DALS(contents))
+class FileBuilder:
+ def unicode_filename(self):
+ try:
+ import test.support
+ except ImportError:
+ # outside CPython, hard-code a unicode snowman
+ return '☃'
+ return test.support.FS_NONASCII or \
+ self.skip("File system does not support non-ascii.")
+
+
def DALS(str):
"Dedent and left-strip"
return textwrap.dedent(str).lstrip()