summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-07-25 00:53:10 (GMT)
committerGitHub <noreply@github.com>2022-07-25 00:53:10 (GMT)
commit3e718cf880e8994d76f6296a502497c16a956644 (patch)
tree4eeeeae42bdb6138b08c5f20711a8b426db606da
parent9007dec606b790c05e158e588b696f3c210c2795 (diff)
downloadcpython-3e718cf880e8994d76f6296a502497c16a956644.zip
cpython-3e718cf880e8994d76f6296a502497c16a956644.tar.gz
cpython-3e718cf880e8994d76f6296a502497c16a956644.tar.bz2
gh-95218: Move tests for importlib.resources into test_importlib.resources. (#95219)
* gh-95218: Move tests for importlib.resources into test_importlib.resources. * Also update makefile * Include test_importlib/resources in code ownership rule.
-rw-r--r--.gitattributes4
-rw-r--r--.github/CODEOWNERS2
-rw-r--r--Lib/test/test_importlib/resources/data01/__init__.py (renamed from Lib/test/test_importlib/zipdata02/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data01/binary.file (renamed from Lib/test/test_importlib/namespacedata01/binary.file)bin4 -> 4 bytes
-rw-r--r--Lib/test/test_importlib/resources/data01/subdirectory/__init__.py (renamed from Lib/test/test_importlib/zipdata01/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data01/subdirectory/binary.file (renamed from Lib/test/test_importlib/data01/subdirectory/binary.file)bin4 -> 4 bytes
-rw-r--r--Lib/test/test_importlib/resources/data01/utf-16.file (renamed from Lib/test/test_importlib/namespacedata01/utf-16.file)bin44 -> 44 bytes
-rw-r--r--Lib/test/test_importlib/resources/data01/utf-8.file (renamed from Lib/test/test_importlib/namespacedata01/utf-8.file)0
-rw-r--r--Lib/test/test_importlib/resources/data02/__init__.py (renamed from Lib/test/test_importlib/data03/namespace/portion2/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data02/one/__init__.py (renamed from Lib/test/test_importlib/data03/namespace/portion1/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data02/one/resource1.txt (renamed from Lib/test/test_importlib/data02/one/resource1.txt)0
-rw-r--r--Lib/test/test_importlib/resources/data02/two/__init__.py (renamed from Lib/test/test_importlib/data03/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data02/two/resource2.txt (renamed from Lib/test/test_importlib/data02/two/resource2.txt)0
-rw-r--r--Lib/test/test_importlib/resources/data03/__init__.py (renamed from Lib/test/test_importlib/data02/two/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data03/namespace/portion1/__init__.py (renamed from Lib/test/test_importlib/data02/one/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data03/namespace/portion2/__init__.py (renamed from Lib/test/test_importlib/data02/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/data03/namespace/resource1.txt (renamed from Lib/test/test_importlib/data03/namespace/resource1.txt)0
-rw-r--r--Lib/test/test_importlib/resources/namespacedata01/binary.file (renamed from Lib/test/test_importlib/data01/binary.file)bin4 -> 4 bytes
-rw-r--r--Lib/test/test_importlib/resources/namespacedata01/utf-16.file (renamed from Lib/test/test_importlib/data01/utf-16.file)bin44 -> 44 bytes
-rw-r--r--Lib/test/test_importlib/resources/namespacedata01/utf-8.file (renamed from Lib/test/test_importlib/data01/utf-8.file)0
-rw-r--r--Lib/test/test_importlib/resources/test_compatibilty_files.py (renamed from Lib/test/test_importlib/test_compatibilty_files.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_contents.py (renamed from Lib/test/test_importlib/test_contents.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_files.py (renamed from Lib/test/test_importlib/test_files.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_open.py (renamed from Lib/test/test_importlib/test_open.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_path.py (renamed from Lib/test/test_importlib/test_path.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_read.py (renamed from Lib/test/test_importlib/test_read.py)2
-rw-r--r--Lib/test/test_importlib/resources/test_reader.py (renamed from Lib/test/test_importlib/test_reader.py)0
-rw-r--r--Lib/test/test_importlib/resources/test_resource.py (renamed from Lib/test/test_importlib/test_resource.py)2
-rwxr-xr-xLib/test/test_importlib/resources/update-zips.py (renamed from Lib/test/test_importlib/update-zips.py)0
-rw-r--r--Lib/test/test_importlib/resources/util.py4
-rw-r--r--Lib/test/test_importlib/resources/zipdata01/__init__.py (renamed from Lib/test/test_importlib/data01/subdirectory/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/zipdata01/ziptestdata.zip (renamed from Lib/test/test_importlib/zipdata01/ziptestdata.zip)bin876 -> 876 bytes
-rw-r--r--Lib/test/test_importlib/resources/zipdata02/__init__.py (renamed from Lib/test/test_importlib/data01/__init__.py)0
-rw-r--r--Lib/test/test_importlib/resources/zipdata02/ziptestdata.zip (renamed from Lib/test/test_importlib/zipdata02/ziptestdata.zip)bin698 -> 698 bytes
-rw-r--r--Makefile.pre.in24
-rw-r--r--Misc/NEWS.d/next/Tests/2022-07-24-17-24-42.gh-issue-95218.zfBLtu.rst1
36 files changed, 25 insertions, 24 deletions
diff --git a/.gitattributes b/.gitattributes
index fb11ddb..79f7b71 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -28,8 +28,8 @@ Lib/test/cjkencodings/* noeol
Lib/test/coding20731.py noeol
Lib/test/decimaltestdata/*.decTest noeol
Lib/test/test_email/data/*.txt noeol
-Lib/test/test_importlib/data01/* noeol
-Lib/test/test_importlib/namespacedata01/* noeol
+Lib/test/test_importlib/resources/data01/* noeol
+Lib/test/test_importlib/resources/namespacedata01/* noeol
Lib/test/xmltestdata/* noeol
# CRLF files
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 013e1cb..df79aa6 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -61,7 +61,7 @@ Python/pythonrun.c @iritkatriel
# bytecode.
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
-**/importlib/resources/* @jaraco @warsaw @brettcannon
+**/*importlib/resources/* @jaraco @warsaw @brettcannon
**/importlib/metadata/* @jaraco @warsaw
# Dates and times
diff --git a/Lib/test/test_importlib/zipdata02/__init__.py b/Lib/test/test_importlib/resources/data01/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/zipdata02/__init__.py
+++ b/Lib/test/test_importlib/resources/data01/__init__.py
diff --git a/Lib/test/test_importlib/namespacedata01/binary.file b/Lib/test/test_importlib/resources/data01/binary.file
index eaf36c1..eaf36c1 100644
--- a/Lib/test/test_importlib/namespacedata01/binary.file
+++ b/Lib/test/test_importlib/resources/data01/binary.file
Binary files differ
diff --git a/Lib/test/test_importlib/zipdata01/__init__.py b/Lib/test/test_importlib/resources/data01/subdirectory/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/zipdata01/__init__.py
+++ b/Lib/test/test_importlib/resources/data01/subdirectory/__init__.py
diff --git a/Lib/test/test_importlib/data01/subdirectory/binary.file b/Lib/test/test_importlib/resources/data01/subdirectory/binary.file
index eaf36c1..eaf36c1 100644
--- a/Lib/test/test_importlib/data01/subdirectory/binary.file
+++ b/Lib/test/test_importlib/resources/data01/subdirectory/binary.file
Binary files differ
diff --git a/Lib/test/test_importlib/namespacedata01/utf-16.file b/Lib/test/test_importlib/resources/data01/utf-16.file
index 2cb7722..2cb7722 100644
--- a/Lib/test/test_importlib/namespacedata01/utf-16.file
+++ b/Lib/test/test_importlib/resources/data01/utf-16.file
Binary files differ
diff --git a/Lib/test/test_importlib/namespacedata01/utf-8.file b/Lib/test/test_importlib/resources/data01/utf-8.file
index 1c0132a..1c0132a 100644
--- a/Lib/test/test_importlib/namespacedata01/utf-8.file
+++ b/Lib/test/test_importlib/resources/data01/utf-8.file
diff --git a/Lib/test/test_importlib/data03/namespace/portion2/__init__.py b/Lib/test/test_importlib/resources/data02/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data03/namespace/portion2/__init__.py
+++ b/Lib/test/test_importlib/resources/data02/__init__.py
diff --git a/Lib/test/test_importlib/data03/namespace/portion1/__init__.py b/Lib/test/test_importlib/resources/data02/one/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data03/namespace/portion1/__init__.py
+++ b/Lib/test/test_importlib/resources/data02/one/__init__.py
diff --git a/Lib/test/test_importlib/data02/one/resource1.txt b/Lib/test/test_importlib/resources/data02/one/resource1.txt
index 61a813e..61a813e 100644
--- a/Lib/test/test_importlib/data02/one/resource1.txt
+++ b/Lib/test/test_importlib/resources/data02/one/resource1.txt
diff --git a/Lib/test/test_importlib/data03/__init__.py b/Lib/test/test_importlib/resources/data02/two/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data03/__init__.py
+++ b/Lib/test/test_importlib/resources/data02/two/__init__.py
diff --git a/Lib/test/test_importlib/data02/two/resource2.txt b/Lib/test/test_importlib/resources/data02/two/resource2.txt
index a80ce46..a80ce46 100644
--- a/Lib/test/test_importlib/data02/two/resource2.txt
+++ b/Lib/test/test_importlib/resources/data02/two/resource2.txt
diff --git a/Lib/test/test_importlib/data02/two/__init__.py b/Lib/test/test_importlib/resources/data03/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data02/two/__init__.py
+++ b/Lib/test/test_importlib/resources/data03/__init__.py
diff --git a/Lib/test/test_importlib/data02/one/__init__.py b/Lib/test/test_importlib/resources/data03/namespace/portion1/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data02/one/__init__.py
+++ b/Lib/test/test_importlib/resources/data03/namespace/portion1/__init__.py
diff --git a/Lib/test/test_importlib/data02/__init__.py b/Lib/test/test_importlib/resources/data03/namespace/portion2/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data02/__init__.py
+++ b/Lib/test/test_importlib/resources/data03/namespace/portion2/__init__.py
diff --git a/Lib/test/test_importlib/data03/namespace/resource1.txt b/Lib/test/test_importlib/resources/data03/namespace/resource1.txt
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data03/namespace/resource1.txt
+++ b/Lib/test/test_importlib/resources/data03/namespace/resource1.txt
diff --git a/Lib/test/test_importlib/data01/binary.file b/Lib/test/test_importlib/resources/namespacedata01/binary.file
index eaf36c1..eaf36c1 100644
--- a/Lib/test/test_importlib/data01/binary.file
+++ b/Lib/test/test_importlib/resources/namespacedata01/binary.file
Binary files differ
diff --git a/Lib/test/test_importlib/data01/utf-16.file b/Lib/test/test_importlib/resources/namespacedata01/utf-16.file
index 2cb7722..2cb7722 100644
--- a/Lib/test/test_importlib/data01/utf-16.file
+++ b/Lib/test/test_importlib/resources/namespacedata01/utf-16.file
Binary files differ
diff --git a/Lib/test/test_importlib/data01/utf-8.file b/Lib/test/test_importlib/resources/namespacedata01/utf-8.file
index 1c0132a..1c0132a 100644
--- a/Lib/test/test_importlib/data01/utf-8.file
+++ b/Lib/test/test_importlib/resources/namespacedata01/utf-8.file
diff --git a/Lib/test/test_importlib/test_compatibilty_files.py b/Lib/test/test_importlib/resources/test_compatibilty_files.py
index 9a823f2..6fa18a2 100644
--- a/Lib/test/test_importlib/test_compatibilty_files.py
+++ b/Lib/test/test_importlib/resources/test_compatibilty_files.py
@@ -8,7 +8,7 @@ from importlib.resources._adapters import (
wrap_spec,
)
-from .resources import util
+from . import util
class CompatibilityFilesTests(unittest.TestCase):
diff --git a/Lib/test/test_importlib/test_contents.py b/Lib/test/test_importlib/resources/test_contents.py
index 3323bf5..1a13f04 100644
--- a/Lib/test/test_importlib/test_contents.py
+++ b/Lib/test/test_importlib/resources/test_contents.py
@@ -2,7 +2,7 @@ import unittest
from importlib import resources
from . import data01
-from .resources import util
+from . import util
class ContentsTests:
diff --git a/Lib/test/test_importlib/test_files.py b/Lib/test/test_importlib/resources/test_files.py
index b9170d8..4665ed7 100644
--- a/Lib/test/test_importlib/test_files.py
+++ b/Lib/test/test_importlib/resources/test_files.py
@@ -4,7 +4,7 @@ import unittest
from importlib import resources
from importlib.abc import Traversable
from . import data01
-from .resources import util
+from . import util
class FilesTests:
diff --git a/Lib/test/test_importlib/test_open.py b/Lib/test/test_importlib/resources/test_open.py
index df75e34..0554c41 100644
--- a/Lib/test/test_importlib/test_open.py
+++ b/Lib/test/test_importlib/resources/test_open.py
@@ -2,7 +2,7 @@ import unittest
from importlib import resources
from . import data01
-from .resources import util
+from . import util
class CommonBinaryTests(util.CommonTests, unittest.TestCase):
diff --git a/Lib/test/test_importlib/test_path.py b/Lib/test/test_importlib/resources/test_path.py
index 6fc41f3..adcf75f 100644
--- a/Lib/test/test_importlib/test_path.py
+++ b/Lib/test/test_importlib/resources/test_path.py
@@ -3,7 +3,7 @@ import unittest
from importlib import resources
from . import data01
-from .resources import util
+from . import util
class CommonTests(util.CommonTests, unittest.TestCase):
diff --git a/Lib/test/test_importlib/test_read.py b/Lib/test/test_importlib/resources/test_read.py
index ebd7226..0ca8ee9 100644
--- a/Lib/test/test_importlib/test_read.py
+++ b/Lib/test/test_importlib/resources/test_read.py
@@ -2,7 +2,7 @@ import unittest
from importlib import import_module, resources
from . import data01
-from .resources import util
+from . import util
class CommonBinaryTests(util.CommonTests, unittest.TestCase):
diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/resources/test_reader.py
index 9d20c97..9d20c97 100644
--- a/Lib/test/test_importlib/test_reader.py
+++ b/Lib/test/test_importlib/resources/test_reader.py
diff --git a/Lib/test/test_importlib/test_resource.py b/Lib/test/test_importlib/resources/test_resource.py
index 834b8bd..1d6df0c 100644
--- a/Lib/test/test_importlib/test_resource.py
+++ b/Lib/test/test_importlib/resources/test_resource.py
@@ -5,7 +5,7 @@ import pathlib
from . import data01
from . import zipdata01, zipdata02
-from .resources import util
+from . import util
from importlib import resources, import_module
from test.support import import_helper
from test.support.os_helper import unlink
diff --git a/Lib/test/test_importlib/update-zips.py b/Lib/test/test_importlib/resources/update-zips.py
index 231334a..231334a 100755
--- a/Lib/test/test_importlib/update-zips.py
+++ b/Lib/test/test_importlib/resources/update-zips.py
diff --git a/Lib/test/test_importlib/resources/util.py b/Lib/test/test_importlib/resources/util.py
index 11c8aa8..f80c9cd 100644
--- a/Lib/test/test_importlib/resources/util.py
+++ b/Lib/test/test_importlib/resources/util.py
@@ -5,8 +5,8 @@ import sys
import types
from pathlib import Path, PurePath
-from .. import data01
-from .. import zipdata01
+from . import data01
+from . import zipdata01
from importlib.abc import ResourceReader
from test.support import import_helper
diff --git a/Lib/test/test_importlib/data01/subdirectory/__init__.py b/Lib/test/test_importlib/resources/zipdata01/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data01/subdirectory/__init__.py
+++ b/Lib/test/test_importlib/resources/zipdata01/__init__.py
diff --git a/Lib/test/test_importlib/zipdata01/ziptestdata.zip b/Lib/test/test_importlib/resources/zipdata01/ziptestdata.zip
index 9a3bb07..9a3bb07 100644
--- a/Lib/test/test_importlib/zipdata01/ziptestdata.zip
+++ b/Lib/test/test_importlib/resources/zipdata01/ziptestdata.zip
Binary files differ
diff --git a/Lib/test/test_importlib/data01/__init__.py b/Lib/test/test_importlib/resources/zipdata02/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data01/__init__.py
+++ b/Lib/test/test_importlib/resources/zipdata02/__init__.py
diff --git a/Lib/test/test_importlib/zipdata02/ziptestdata.zip b/Lib/test/test_importlib/resources/zipdata02/ziptestdata.zip
index d63ff51..d63ff51 100644
--- a/Lib/test/test_importlib/zipdata02/ziptestdata.zip
+++ b/Lib/test/test_importlib/resources/zipdata02/ziptestdata.zip
Binary files differ
diff --git a/Makefile.pre.in b/Makefile.pre.in
index dd02165..ab44f21 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1926,15 +1926,6 @@ TESTSUBDIRS= distutils/tests \
test/test_importlib \
test/test_importlib/builtin \
test/test_importlib/data \
- test/test_importlib/data01 \
- test/test_importlib/data01/subdirectory \
- test/test_importlib/data02 \
- test/test_importlib/data02/one \
- test/test_importlib/data02/two \
- test/test_importlib/data03 \
- test/test_importlib/data03/namespace \
- test/test_importlib/data03/namespace/portion1 \
- test/test_importlib/data03/namespace/portion2 \
test/test_importlib/extension \
test/test_importlib/frozen \
test/test_importlib/import_ \
@@ -1958,12 +1949,21 @@ TESTSUBDIRS= distutils/tests \
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/partial \
test/test_importlib/resources \
+ test/test_importlib/resources/data01 \
+ test/test_importlib/resources/data01/subdirectory \
+ test/test_importlib/resources/data02 \
+ test/test_importlib/resources/data02/one \
+ test/test_importlib/resources/data02/two \
+ test/test_importlib/resources/data03 \
+ test/test_importlib/resources/data03/namespace \
+ test/test_importlib/resources/data03/namespace/portion1 \
+ test/test_importlib/resources/data03/namespace/portion2 \
+ test/test_importlib/resources/namespacedata01 \
+ test/test_importlib/resources/zipdata01 \
+ test/test_importlib/resources/zipdata02 \
test/test_importlib/source \
- test/test_importlib/zipdata01 \
- test/test_importlib/zipdata02 \
test/test_json \
test/test_lib2to3 \
test/test_lib2to3/data \
diff --git a/Misc/NEWS.d/next/Tests/2022-07-24-17-24-42.gh-issue-95218.zfBLtu.rst b/Misc/NEWS.d/next/Tests/2022-07-24-17-24-42.gh-issue-95218.zfBLtu.rst
new file mode 100644
index 0000000..7326689
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-07-24-17-24-42.gh-issue-95218.zfBLtu.rst
@@ -0,0 +1 @@
+Move tests for importlib.resources into test_importlib.resources.