[Python-checkins] bpo-43288: Fix bug in test_importlib test. (GH-24612)
nascheme
webhook-mailer at python.org
Sun Feb 21 16:48:26 EST 2021
https://github.com/python/cpython/commit/50288aa8c955f66ab67a7dadf250ea5f4238eb67
commit: 50288aa8c955f66ab67a7dadf250ea5f4238eb67
branch: master
author: Neil Schemenauer <nas-github at arctrix.com>
committer: nascheme <nas-github at arctrix.com>
date: 2021-02-21T13:48:18-08:00
summary:
bpo-43288: Fix bug in test_importlib test. (GH-24612)
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 429313e9efb98..d5bd74ef0ffed 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
from test.support.os_helper import FS_NONASCII
from typing import Dict, Union
@@ -219,6 +220,9 @@ def setUp(self):
self.fixtures.enter_context(tempdir_as_cwd())
build_files(self.files)
+ def skip(self, reason):
+ raise unittest.SkipTest(reason)
+
def build_files(file_defs, prefix=pathlib.Path()):
"""Build a set of files/directories, as described by the
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