]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-43288: Fix bug in test_importlib test. (GH-24616)
authorNeil Schemenauer <nas-github@arctrix.com>
Sun, 21 Feb 2021 23:24:41 +0000 (15:24 -0800)
committerGitHub <noreply@github.com>
Sun, 21 Feb 2021 23:24:41 +0000 (15:24 -0800)
* bpo-43288: Fix bug in test_importlib test. (GH-24612)
* Fix failed merge of bpo-43288. (GH-24614)

Lib/test/test_importlib/fixtures.py
Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst [new file with mode: 0644]

index 2e55d14b9aab9713147497c7de32a58e3c663577..d71f2644066e5bedcab9ecf755e48ebab7eb8447 100644 (file)
@@ -5,6 +5,7 @@ import pathlib
 import tempfile
 import textwrap
 import contextlib
+import unittest
 
 
 @contextlib.contextmanager
@@ -220,6 +221,9 @@ class FileBuilder:
         return test.support.FS_NONASCII or \
             self.skip("File system does not support non-ascii.")
 
+    def skip(self, reason):
+        raise unittest.SkipTest(reason)
+
 
 def DALS(str):
     "Dedent and left-strip"
diff --git a/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst b/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst
new file mode 100644 (file)
index 0000000..8463540
--- /dev/null
@@ -0,0 +1,2 @@
+Fix test_importlib to correctly skip Unicode file tests if the fileystem
+does not support them.