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
This commit is contained in:
Jason R. Coombs 2024-03-20 17:11:00 -04:00 committed by GitHub
parent 7d446548ef
commit 8ad8898420
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 7 additions and 3 deletions

2
.github/CODEOWNERS vendored
View file

@ -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

View file

@ -9,6 +9,7 @@
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 @@ def add_sys_path(dir):
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)

View file

@ -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 \

View file

@ -0,0 +1 @@
Consolidated tests for importlib.metadata in their own ``metadata`` package.