summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/fixtures.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-07 15:17:45 (GMT)
committerGitHub <noreply@github.com>2020-06-07 15:17:45 (GMT)
commit71f501698d64af6463246bc6efdbbf1b85616102 (patch)
tree1178b46b924cad161aa09bc940e5fa2a0d47680a /Lib/test/test_importlib/fixtures.py
parent1d711f2e31e02b2e9cbe4f109bf79541f56c35a2 (diff)
downloadcpython-71f501698d64af6463246bc6efdbbf1b85616102.zip
cpython-71f501698d64af6463246bc6efdbbf1b85616102.tar.gz
cpython-71f501698d64af6463246bc6efdbbf1b85616102.tar.bz2
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (GH-20681)
(cherry picked from commit 2efe18bf277dd0f38a1d248ae6bdd30947c26880) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
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 b25febb..2e55d14 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()