Skip to content

Commit adf1dc9

Browse files
committed
Skip the failing test on buildbots only.
1 parent 5389340 commit adf1dc9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
import unittest
3+
4+
5+
def skip_on_buildbot(func):
6+
"""
7+
#132947 revealed that after applying some otherwise stable
8+
changes, only on some buildbot runners, the tests will fail with
9+
ResourceWarnings.
10+
"""
11+
is_buildbot = 'BUILDBOT_RUN' in os.environ or 'BUILDBOT' in os.environ
12+
skipper = unittest.skip("Causes Resource Warnings (python/cpython#132947)")
13+
wrapper = skipper if is_buildbot else lambda x: x
14+
return wrapper(func)

Lib/test/test_importlib/metadata/test_main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
)
2323

2424
from . import fixtures
25+
from . import _issue132947
2526
from ._path import Symlink
2627

2728

@@ -357,6 +358,7 @@ def test_packages_distributions_example(self):
357358
self._fixture_on_path('example-21.12-py3-none-any.whl')
358359
assert packages_distributions()['example'] == ['example']
359360

361+
@_issue132947.skip_on_buildbot
360362
def test_packages_distributions_example2(self):
361363
"""
362364
Test packages_distributions on a wheel built

0 commit comments

Comments
 (0)