(root)/
Python-3.11.7/
Lib/
test/
test_check_c_globals.py
       1  import unittest
       2  import test.test_tools
       3  from test.support.warnings_helper import save_restore_warnings_filters
       4  
       5  test.test_tools.skip_if_missing('c-analyzer')
       6  with test.test_tools.imports_under_tool('c-analyzer'):
       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
      12  
      13  
      14  class ESC[4;38;5;81mActualChecks(ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      15  
      16      # XXX Also run the check in "make check".
      17      #@unittest.expectedFailure
      18      # Failing on one of the buildbots (see https://bugs.python.org/issue36876).
      19      @unittest.skip('activate this once all the globals have been resolved')
      20      def test_check_c_globals(self):
      21          try:
      22              main('check', {})
      23          except NotImplementedError:
      24              raise unittest.SkipTest('not supported on this host')
      25  
      26  
      27  if __name__ == '__main__':
      28      # Test needs to be a package, so we can do relative imports.
      29      unittest.main()