From bb6db97b8cdb3781511ac7781b89778813ae4514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 30 Jul 2021 15:54:23 +0100 Subject: [PATCH 1/2] bpo-44771: rename namespacedata01 to namespacedata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should fix the buildbots, see https://github.com/python/cpython/pull/27436#issuecomment-889896711 Signed-off-by: Filipe Laíns --- .../binary.file | Bin .../utf-16.file | Bin .../utf-8.file | 0 Lib/test/test_importlib/test_contents.py | 4 ++-- Lib/test/test_importlib/test_files.py | 4 ++-- Lib/test/test_importlib/test_open.py | 4 ++-- Lib/test/test_importlib/test_read.py | 4 ++-- Lib/test/test_importlib/test_reader.py | 18 +++++++++--------- Lib/test/test_importlib/test_resource.py | 8 ++++---- Makefile.pre.in | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) rename Lib/test/test_importlib/{namespacedata01 => namespacedata}/binary.file (100%) rename Lib/test/test_importlib/{namespacedata01 => namespacedata}/utf-16.file (100%) rename Lib/test/test_importlib/{namespacedata01 => namespacedata}/utf-8.file (100%) diff --git a/Lib/test/test_importlib/namespacedata01/binary.file b/Lib/test/test_importlib/namespacedata/binary.file similarity index 100% rename from Lib/test/test_importlib/namespacedata01/binary.file rename to Lib/test/test_importlib/namespacedata/binary.file diff --git a/Lib/test/test_importlib/namespacedata01/utf-16.file b/Lib/test/test_importlib/namespacedata/utf-16.file similarity index 100% rename from Lib/test/test_importlib/namespacedata01/utf-16.file rename to Lib/test/test_importlib/namespacedata/utf-16.file diff --git a/Lib/test/test_importlib/namespacedata01/utf-8.file b/Lib/test/test_importlib/namespacedata/utf-8.file similarity index 100% rename from Lib/test/test_importlib/namespacedata01/utf-8.file rename to Lib/test/test_importlib/namespacedata/utf-8.file diff --git a/Lib/test/test_importlib/test_contents.py b/Lib/test/test_importlib/test_contents.py index 0f3aa84f5b5127..d842f1881dc55c 100644 --- a/Lib/test/test_importlib/test_contents.py +++ b/Lib/test/test_importlib/test_contents.py @@ -37,6 +37,6 @@ class ContentsNamespaceTests(ContentsTests, unittest.TestCase): } def setUp(self): - from . import namespacedata01 + from . import namespacedata - self.data = namespacedata01 + self.data = namespacedata diff --git a/Lib/test/test_importlib/test_files.py b/Lib/test/test_importlib/test_files.py index b9170d83bea912..31eea4e5c3757f 100644 --- a/Lib/test/test_importlib/test_files.py +++ b/Lib/test/test_importlib/test_files.py @@ -37,9 +37,9 @@ class OpenZipTests(FilesTests, util.ZipSetup, unittest.TestCase): class OpenNamespaceTests(FilesTests, unittest.TestCase): def setUp(self): - from . import namespacedata01 + from . import namespacedata - self.data = namespacedata01 + self.data = namespacedata if __name__ == '__main__': diff --git a/Lib/test/test_importlib/test_open.py b/Lib/test/test_importlib/test_open.py index 6f88ff78b73a0c..7203083a469e60 100644 --- a/Lib/test/test_importlib/test_open.py +++ b/Lib/test/test_importlib/test_open.py @@ -64,9 +64,9 @@ def setUp(self): class OpenDiskNamespaceTests(OpenTests, unittest.TestCase): def setUp(self): - from . import namespacedata01 + from . import namespacedata - self.data = namespacedata01 + self.data = namespacedata class OpenZipTests(OpenTests, util.ZipSetup, unittest.TestCase): diff --git a/Lib/test/test_importlib/test_read.py b/Lib/test/test_importlib/test_read.py index 357980132b6ec6..dc72bbdf31ccbd 100644 --- a/Lib/test/test_importlib/test_read.py +++ b/Lib/test/test_importlib/test_read.py @@ -57,9 +57,9 @@ def test_read_submodule_resource_by_name(self): class ReadNamespaceTests(ReadTests, unittest.TestCase): def setUp(self): - from . import namespacedata01 + from . import namespacedata - self.data = namespacedata01 + self.data = namespacedata if __name__ == '__main__': diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/test_reader.py index 9d20c976b82505..c9bc8d21ac8c5a 100644 --- a/Lib/test/test_importlib/test_reader.py +++ b/Lib/test/test_importlib/test_reader.py @@ -10,7 +10,7 @@ class MultiplexedPathTest(unittest.TestCase): @classmethod def setUpClass(cls): - path = pathlib.Path(__file__).parent / 'namespacedata01' + path = pathlib.Path(__file__).parent / 'namespacedata' cls.folder = str(path) def test_init_no_paths(self): @@ -65,7 +65,7 @@ def test_join_path(self): path = MultiplexedPath(self.folder, data01) self.assertEqual( str(path.joinpath('binary.file'))[len(prefix) + 1 :], - os.path.join('namespacedata01', 'binary.file'), + os.path.join('namespacedata', 'binary.file'), ) self.assertEqual( str(path.joinpath('subdirectory'))[len(prefix) + 1 :], @@ -73,7 +73,7 @@ def test_join_path(self): ) self.assertEqual( str(path.joinpath('imaginary'))[len(prefix) + 1 :], - os.path.join('namespacedata01', 'imaginary'), + os.path.join('namespacedata', 'imaginary'), ) def test_repr(self): @@ -105,10 +105,10 @@ def test_init_error(self): NamespaceReader(['path1', 'path2']) def test_resource_path(self): - namespacedata01 = import_module('namespacedata01') - reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations) + namespacedata = import_module('namespacedata01') + reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations) - root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01')) + root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata')) self.assertEqual( reader.resource_path('binary.file'), os.path.join(root, 'binary.file') ) @@ -117,9 +117,9 @@ def test_resource_path(self): ) def test_files(self): - namespacedata01 = import_module('namespacedata01') - reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations) - root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01')) + namespacedata = import_module('namespacedata01') + reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations) + root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata')) self.assertIsInstance(reader.files(), MultiplexedPath) self.assertEqual(repr(reader.files()), f"MultiplexedPath('{root}')") diff --git a/Lib/test/test_importlib/test_resource.py b/Lib/test/test_importlib/test_resource.py index 612bada5e0316c..601ce0ff54e59e 100644 --- a/Lib/test/test_importlib/test_resource.py +++ b/Lib/test/test_importlib/test_resource.py @@ -227,14 +227,14 @@ def tearDownClass(cls): def test_is_submodule_resource(self): self.assertTrue( - resources.is_resource(import_module('namespacedata01'), 'binary.file') + resources.is_resource(import_module('namespacedata'), 'binary.file') ) def test_read_submodule_resource_by_name(self): - self.assertTrue(resources.is_resource('namespacedata01', 'binary.file')) + self.assertTrue(resources.is_resource('namespacedata', 'binary.file')) def test_submodule_contents(self): - contents = set(resources.contents(import_module('namespacedata01'))) + contents = set(resources.contents(import_module('namespacedata'))) try: contents.remove('__pycache__') except KeyError: @@ -242,7 +242,7 @@ def test_submodule_contents(self): self.assertEqual(contents, {'binary.file', 'utf-8.file', 'utf-16.file'}) def test_submodule_contents_by_name(self): - contents = set(resources.contents('namespacedata01')) + contents = set(resources.contents('namespacedata')) try: contents.remove('__pycache__') except KeyError: diff --git a/Makefile.pre.in b/Makefile.pre.in index bf023a084dc478..ff4334563eafec 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1514,7 +1514,7 @@ TESTSUBDIRS= ctypes/test \ test/test_importlib/namespace_pkgs/project3 \ test/test_importlib/namespace_pkgs/project3/parent \ test/test_importlib/namespace_pkgs/project3/parent/child \ - test/test_importlib/namespacedata01 \ + test/test_importlib/namespacedata \ test/test_importlib/partial \ test/test_importlib/source \ test/test_importlib/zipdata01 \ From e1a911e4bb2774521fb44ed199184fd92262acec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 30 Jul 2021 16:07:10 +0100 Subject: [PATCH 2/2] add missing reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- Lib/test/test_importlib/test_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/test_reader.py index c9bc8d21ac8c5a..9aa562b10a02b4 100644 --- a/Lib/test/test_importlib/test_reader.py +++ b/Lib/test/test_importlib/test_reader.py @@ -105,7 +105,7 @@ def test_init_error(self): NamespaceReader(['path1', 'path2']) def test_resource_path(self): - namespacedata = import_module('namespacedata01') + namespacedata = import_module('namespacedata') reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations) root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata')) @@ -117,7 +117,7 @@ def test_resource_path(self): ) def test_files(self): - namespacedata = import_module('namespacedata01') + namespacedata = import_module('namespacedata') reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations) root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata')) self.assertIsInstance(reader.files(), MultiplexedPath)