summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2024-03-20 21:11:00 (GMT)
committerGitHub <noreply@github.com>2024-03-20 21:11:00 (GMT)
commit8ad88984200b2ccddc0a08229dd2f4c14d1a71fc (patch)
tree4bb7cd458246b2bccf5a6bb1a79e453793b94d24
parent7d446548ef53f6c3de1097c6d44cada6642ddc85 (diff)
downloadcpython-8ad88984200b2ccddc0a08229dd2f4c14d1a71fc.zip
cpython-8ad88984200b2ccddc0a08229dd2f4c14d1a71fc.tar.gz
cpython-8ad88984200b2ccddc0a08229dd2f4c14d1a71fc.tar.bz2
gh-117089: Move importlib.metadata tests to their own package (#117092)
* Ensure importlib.metadata tests do not leak references in sys.modules. * Move importlib.metadata tests to their own package for easier syncing with importlib_metadata. * Update owners and makefile for new directories. * Add blurb
-rw-r--r--.github/CODEOWNERS2
-rw-r--r--Lib/test/test_importlib/metadata/__init__.py (renamed from Lib/test/test_importlib/data/__init__.py)0
-rw-r--r--Lib/test/test_importlib/metadata/_context.py (renamed from Lib/test/test_importlib/_context.py)0
-rw-r--r--Lib/test/test_importlib/metadata/_path.py (renamed from Lib/test/test_importlib/_path.py)0
-rw-r--r--Lib/test/test_importlib/metadata/data/__init__.py0
-rw-r--r--Lib/test/test_importlib/metadata/data/example-21.12-py3-none-any.whl (renamed from Lib/test/test_importlib/data/example-21.12-py3-none-any.whl)bin1455 -> 1455 bytes
-rw-r--r--Lib/test/test_importlib/metadata/data/example-21.12-py3.6.egg (renamed from Lib/test/test_importlib/data/example-21.12-py3.6.egg)bin1497 -> 1497 bytes
-rw-r--r--Lib/test/test_importlib/metadata/data/example2-1.0.0-py3-none-any.whl (renamed from Lib/test/test_importlib/data/example2-1.0.0-py3-none-any.whl)bin1167 -> 1167 bytes
-rw-r--r--Lib/test/test_importlib/metadata/fixtures.py (renamed from Lib/test/test_importlib/fixtures.py)4
-rw-r--r--Lib/test/test_importlib/metadata/stubs.py (renamed from Lib/test/test_importlib/stubs.py)0
-rw-r--r--Lib/test/test_importlib/metadata/test_api.py (renamed from Lib/test/test_importlib/test_metadata_api.py)0
-rw-r--r--Lib/test/test_importlib/metadata/test_main.py (renamed from Lib/test/test_importlib/test_main.py)0
-rw-r--r--Lib/test/test_importlib/metadata/test_zip.py (renamed from Lib/test/test_importlib/test_zip.py)0
-rw-r--r--Makefile.pre.in3
-rw-r--r--Misc/NEWS.d/next/Tests/2024-03-20-14-19-32.gh-issue-117089.WwR1Z1.rst1
15 files changed, 7 insertions, 3 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index e8eed40..235bc78 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -119,7 +119,7 @@ Python/dynload_*.c @ericsnowcurrently
Lib/test/test_module/ @ericsnowcurrently
Doc/c-api/module.rst @ericsnowcurrently
**/*importlib/resources/* @jaraco @warsaw @FFY00
-**/importlib/metadata/* @jaraco @warsaw
+**/*importlib/metadata/* @jaraco @warsaw
# Dates and times
**/*datetime* @pganssle @abalkin
diff --git a/Lib/test/test_importlib/data/__init__.py b/Lib/test/test_importlib/metadata/__init__.py
index e69de29..e69de29 100644
--- a/Lib/test/test_importlib/data/__init__.py
+++ b/Lib/test/test_importlib/metadata/__init__.py
diff --git a/Lib/test/test_importlib/_context.py b/Lib/test/test_importlib/metadata/_context.py
index 8a53eb5..8a53eb5 100644
--- a/Lib/test/test_importlib/_context.py
+++ b/Lib/test/test_importlib/metadata/_context.py
diff --git a/Lib/test/test_importlib/_path.py b/Lib/test/test_importlib/metadata/_path.py
index 25c799f..25c799f 100644
--- a/Lib/test/test_importlib/_path.py
+++ b/Lib/test/test_importlib/metadata/_path.py
diff --git a/Lib/test/test_importlib/metadata/data/__init__.py b/Lib/test/test_importlib/metadata/data/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Lib/test/test_importlib/metadata/data/__init__.py
diff --git a/Lib/test/test_importlib/data/example-21.12-py3-none-any.whl b/Lib/test/test_importlib/metadata/data/example-21.12-py3-none-any.whl
index 641ab07..641ab07 100644
--- a/Lib/test/test_importlib/data/example-21.12-py3-none-any.whl
+++ b/Lib/test/test_importlib/metadata/data/example-21.12-py3-none-any.whl
Binary files differ
diff --git a/Lib/test/test_importlib/data/example-21.12-py3.6.egg b/Lib/test/test_importlib/metadata/data/example-21.12-py3.6.egg
index cdb298a..cdb298a 100644
--- a/Lib/test/test_importlib/data/example-21.12-py3.6.egg
+++ b/Lib/test/test_importlib/metadata/data/example-21.12-py3.6.egg
Binary files differ
diff --git a/Lib/test/test_importlib/data/example2-1.0.0-py3-none-any.whl b/Lib/test/test_importlib/metadata/data/example2-1.0.0-py3-none-any.whl
index 5ca9365..5ca9365 100644
--- a/Lib/test/test_importlib/data/example2-1.0.0-py3-none-any.whl
+++ b/Lib/test/test_importlib/metadata/data/example2-1.0.0-py3-none-any.whl
Binary files differ
diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/metadata/fixtures.py
index 8c97335..f23ac5d 100644
--- a/Lib/test/test_importlib/fixtures.py
+++ b/Lib/test/test_importlib/metadata/fixtures.py
@@ -9,6 +9,7 @@ import textwrap
import functools
import contextlib
+from test.support import import_helper
from test.support.os_helper import FS_NONASCII
from test.support import requires_zlib
@@ -85,6 +86,7 @@ class OnSysPath(Fixtures):
def setUp(self):
super().setUp()
self.fixtures.enter_context(self.add_sys_path(self.site_dir))
+ self.fixtures.enter_context(import_helper.isolated_modules())
class SiteBuilder(SiteDir):
@@ -348,7 +350,7 @@ def DALS(str):
@requires_zlib()
class ZipFixtures:
- root = 'test.test_importlib.data'
+ root = 'test.test_importlib.metadata.data'
def _fixture_on_path(self, filename):
pkg_file = resources.files(self.root).joinpath(filename)
diff --git a/Lib/test/test_importlib/stubs.py b/Lib/test/test_importlib/metadata/stubs.py
index e5b011c..e5b011c 100644
--- a/Lib/test/test_importlib/stubs.py
+++ b/Lib/test/test_importlib/metadata/stubs.py
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/metadata/test_api.py
index 33c6e85..33c6e85 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/metadata/test_api.py
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/metadata/test_main.py
index 0a769b8..0a769b8 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/metadata/test_main.py
diff --git a/Lib/test/test_importlib/test_zip.py b/Lib/test/test_importlib/metadata/test_zip.py
index 276f628..276f628 100644
--- a/Lib/test/test_importlib/test_zip.py
+++ b/Lib/test/test_importlib/metadata/test_zip.py
diff --git a/Makefile.pre.in b/Makefile.pre.in
index b9f790a..1451cf3 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -2351,10 +2351,11 @@ TESTSUBDIRS= idlelib/idle_test \
test/test_import/data/unwritable \
test/test_importlib \
test/test_importlib/builtin \
- test/test_importlib/data \
test/test_importlib/extension \
test/test_importlib/frozen \
test/test_importlib/import_ \
+ test/test_importlib/metadata \
+ test/test_importlib/metadata/data \
test/test_importlib/namespace_pkgs \
test/test_importlib/namespace_pkgs/both_portions \
test/test_importlib/namespace_pkgs/both_portions/foo \
diff --git a/Misc/NEWS.d/next/Tests/2024-03-20-14-19-32.gh-issue-117089.WwR1Z1.rst b/Misc/NEWS.d/next/Tests/2024-03-20-14-19-32.gh-issue-117089.WwR1Z1.rst
new file mode 100644
index 0000000..ab0baec
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2024-03-20-14-19-32.gh-issue-117089.WwR1Z1.rst
@@ -0,0 +1 @@
+Consolidated tests for importlib.metadata in their own ``metadata`` package.