1import unittest
2import test.test_tools
3from test.support.warnings_helper import save_restore_warnings_filters
4
5test.test_tools.skip_if_missing('c-analyzer')
6with 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
14class ActualChecks(unittest.TestCase):
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
27if __name__ == '__main__':
28    # Test needs to be a package, so we can do relative imports.
29    unittest.main()
30