[Python-checkins] [3.9] bpo-43288: Fix bug in test_importlib test. (GH-24616)

nascheme webhook-mailer at python.org
Sun Feb 21 18:24:50 EST 2021


https://github.com/python/cpython/commit/44fe32061d60f4bd9c4fa48c24e3e4ba26033dba
commit: 44fe32061d60f4bd9c4fa48c24e3e4ba26033dba
branch: 3.9
author: Neil Schemenauer <nas-github at arctrix.com>
committer: nascheme <nas-github at arctrix.com>
date: 2021-02-21T15:24:41-08:00
summary:

[3.9] bpo-43288: Fix bug in test_importlib test. (GH-24616)

* bpo-43288: Fix bug in test_importlib test. (GH-24612)
* Fix failed merge of bpo-43288. (GH-24614)

files:
A Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst
M Lib/test/test_importlib/fixtures.py

diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py
index 2e55d14b9aab9..d71f2644066e5 100644
--- a/Lib/test/test_importlib/fixtures.py
+++ b/Lib/test/test_importlib/fixtures.py
@@ -5,6 +5,7 @@
 import tempfile
 import textwrap
 import contextlib
+import unittest
 
 
 @contextlib.contextmanager
@@ -220,6 +221,9 @@ def unicode_filename(self):
         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
index 0000000000000..8463540ae8a14
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst
@@ -0,0 +1,2 @@
+Fix test_importlib to correctly skip Unicode file tests if the fileystem
+does not support them.



More information about the Python-checkins mailing list