mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-138313: Suppress ResourceWarnings and restore skipped test (#138597)
This commit is contained in:
parent
9c3d09b984
commit
a756a4b953
4 changed files with 4 additions and 17 deletions
|
|
@ -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)
|
|
||||||
|
|
@ -374,6 +374,8 @@ def setUp(self):
|
||||||
# Add self.zip_name to the front of sys.path.
|
# Add self.zip_name to the front of sys.path.
|
||||||
self.resources = contextlib.ExitStack()
|
self.resources = contextlib.ExitStack()
|
||||||
self.addCleanup(self.resources.close)
|
self.addCleanup(self.resources.close)
|
||||||
|
# workaround for #138313
|
||||||
|
self.addCleanup(lambda: None)
|
||||||
|
|
||||||
|
|
||||||
def parameterize(*args_set):
|
def parameterize(*args_set):
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import fixtures
|
from . import fixtures
|
||||||
from . import _issue138313
|
|
||||||
from ._path import Symlink
|
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')
|
self._fixture_on_path('example-21.12-py3-none-any.whl')
|
||||||
assert packages_distributions()['example'] == ['example']
|
assert packages_distributions()['example'] == ['example']
|
||||||
|
|
||||||
@_issue138313.skip_on_buildbot
|
|
||||||
def test_packages_distributions_example2(self):
|
def test_packages_distributions_example2(self):
|
||||||
"""
|
"""
|
||||||
Test packages_distributions on a wheel built
|
Test packages_distributions on a wheel built
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
Restore skipped test and add janky workaround to prevent select buildbots
|
||||||
|
from failing with a ResourceWarning.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue