Skip to content

Commit

Permalink
pythongh-95349: Hide a Distutils Warning Filter for test_check_c_glob…
Browse files Browse the repository at this point in the history
…als (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.
  • Loading branch information
ericsnowcurrently authored and iritkatriel committed Aug 11, 2022
1 parent 866a5b1 commit 9f5868c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/test/test_check_c_globals.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import unittest
import test.test_tools
from test.support.warnings_helper import save_restore_warnings_filters

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


class ActualChecks(unittest.TestCase):
Expand Down

0 comments on commit 9f5868c

Please sign in to comment.