Debian Codegraph @

Lib/test/test_tools/test_sundry.py

raw
1 """Tests for scripts in the Tools/scripts directory.
2
3 This file contains extremely basic regression tests for the scripts found in
4 the Tools directory of a Python checkout or tarball which don't have separate
5 tests of their own.
6 """
7
8 import os
9 import unittest
10 from test.support import import_helper
11
12 from test.test_tools import scriptsdir, import_tool, skip_if_missing
13
14 skip_if_missing()
15
16 class TestSundryScripts(unittest.TestCase):
17 # import logging registers "atfork" functions which keep indirectly the
18 # logging module dictionary alive. Mock the function to be able to unload
19 # cleanly the logging module.
20 @import_helper.mock_register_at_fork
21 def test_sundry(self, mock_os):
22 for fn in os.listdir(scriptsdir):
23 if not fn.endswith('.py'):
24 continue
25 name = fn[:-3]
26 import_tool(name)
27
28
29 if __name__ == '__main__':
30 unittest.main()