8000 gh-95349: Hide a Distutils Warning Filter for test_check_c_globals (G… · miss-islington/cpython@3ff6d9a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ff6d9a

Browse files
pythongh-95349: Hide a Distutils Warning Filter for test_check_c_globals (pythonGH-95837)
Under certain build conditions, test_check_c_globals fails. This fix takes the same approach as we took for pythongh-84236 (via pythongh-20095). We'll be removing use of distutils in the c-analyzer at some point. Until then we'll hide the warning filter.
1 parent <
8000
a class="color-fg-default Link--inTextBlock prc-Link-Link-85e08" data-hotkey="p" data-hovercard-url="/miss-islington/cpython/commit/70fc9641b56144854777aef29c145cd10789e3df/hovercard" href="/miss-islington/cpython/commit/70fc9641b56144854777aef29c145cd10789e3df" data-discover="true">70fc964 commit 3ff6d9a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/test/test_check_c_globals.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import unittest
22
import test.test_tools
3+
from test.support.warnings_helper import save_restore_warnings_filters
34

45
test.test_tools.skip_if_missing('c-analyzer')
56
with test.test_tools.imports_under_tool('c-analyzer'):
6-
from cpython.__main__ import main
7+
# gh-95349: Save/restore warnings filters to leave them unchanged.
8+
# Importing the c-analyzer imports docutils which imports pkg_resources
9+
# which adds a warnings filter.
10+
with save_restore_warnings_filters():
11+
from cpython.__main__ import main
712

813

914
class ActualChecks(unittest.TestCase):

0 commit comments

Comments
 (0)
0