From 50288aa8c955f66ab67a7dadf250ea5f4238eb67 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Sun, 21 Feb 2021 13:48:18 -0800 Subject: bpo-43288: Fix bug in test_importlib test. (GH-24612) --- Lib/test/test_importlib/fixtures.py | 4 ++++ Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2021-02-21-11-11-53.bpo-43288.LfTvL-.rst diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index 429313e..d5bd74e 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -5,6 +5,7 @@ import pathlib 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 @@ class LocalPackage: 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 0000000..8463540 --- /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. -- cgit v0.12