https://github.com/python/cpython/commit/a756a4b95341cda63298fb5628b56c32f43f4f1e
commit: a756a4b95341cda63298fb5628b56c32f43f4f1e
branch: main
author: Jason R. Coombs <[email protected]>
committer: jaraco <[email protected]>
date: 2025-09-21T20:53:57-04:00
summary:
gh-138313: Suppress ResourceWarnings and restore skipped test (#138597)
files:
A Misc/NEWS.d/next/Tests/2025-09-21-16-00-30.gh-issue-138313.lBx2en.rst
D Lib/test/test_importlib/metadata/_issue138313.py
M Lib/test/test_importlib/metadata/fixtures.py
M Lib/test/test_importlib/metadata/test_main.py
diff --git a/Lib/test/test_importlib/metadata/_issue138313.py
b/Lib/test/test_importlib/metadata/_issue138313.py
deleted file mode 100644
index 4e1c57e622d657..00000000000000
--- a/Lib/test/test_importlib/metadata/_issue138313.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import os
-import unittest
-
-
-def skip_on_buildbot(func):
- """
- #132947 revealed that after applying some otherwise stable
- changes, only on some buildbot runners, the tests will fail with
- ResourceWarnings.
- """
- # detect "not github actions" as a proxy for BUILDBOT not being present
yet.
- is_buildbot = "GITHUB_ACTION" not in os.environ or "BUILDBOT" in os.environ
- skipper = unittest.skip("Causes Resource Warnings (python/cpython#132947)")
- wrapper = skipper if is_buildbot else lambda x: x
- return wrapper(func)
diff --git a/Lib/test/test_importlib/metadata/fixtures.py
b/Lib/test/test_importlib/metadata/fixtures.py
index 494047dc98f9b6..ad0ab42e089a9d 100644
--- a/Lib/test/test_importlib/metadata/fixtures.py
+++ b/Lib/test/test_importlib/metadata/fixtures.py
@@ -374,6 +374,8 @@ def setUp(self):
# Add self.zip_name to the front of sys.path.
self.resources = contextlib.ExitStack()
self.addCleanup(self.resources.close)
+ # workaround for #138313
+ self.addCleanup(lambda: None)
def parameterize(*args_set):
diff --git a/Lib/test/test_importlib/metadata/test_main.py
b/Lib/test/test_importlib/metadata/test_main.py
index 71bdd5f0d25943..83b686babfdb7a 100644
--- a/Lib/test/test_importlib/metadata/test_main.py
+++ b/Lib/test/test_importlib/metadata/test_main.py
@@ -22,7 +22,6 @@
)
from . import fixtures
-from . import _issue138313
from ._path import Symlink
@@ -358,7 +357,6 @@ def test_packages_distributions_example(self):
self._fixture_on_path('example-21.12-py3-none-any.whl')
assert packages_distributions()['example'] == ['example']
- @_issue138313.skip_on_buildbot
def test_packages_distributions_example2(self):
"""
Test packages_distributions on a wheel built
diff --git
a/Misc/NEWS.d/next/Tests/2025-09-21-16-00-30.gh-issue-138313.lBx2en.rst
b/Misc/NEWS.d/next/Tests/2025-09-21-16-00-30.gh-issue-138313.lBx2en.rst
new file mode 100644
index 00000000000000..b70c59201dfe27
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2025-09-21-16-00-30.gh-issue-138313.lBx2en.rst
@@ -0,0 +1,2 @@
+Restore skipped test and add janky workaround to prevent select buildbots
+from failing with a ResourceWarning.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]