2023-04-29 16:11:15 -03:00
|
|
|
"""Tests for scripts in the Tools/scripts directory.
|
2014-07-16 16:26:09 -03:00
|
|
|
|
|
|
|
This file contains extremely basic regression tests for the scripts found in
|
|
|
|
the Tools directory of a Python checkout or tarball which don't have separate
|
2019-07-30 12:45:09 -03:00
|
|
|
tests of their own.
|
2014-07-16 16:26:09 -03:00
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import unittest
|
2020-08-04 12:53:12 -03:00
|
|
|
from test.support import import_helper
|
2014-07-16 16:26:09 -03:00
|
|
|
|
|
|
|
from test.test_tools import scriptsdir, import_tool, skip_if_missing
|
|
|
|
|
|
|
|
skip_if_missing()
|
|
|
|
|
|
|
|
class TestSundryScripts(unittest.TestCase):
|
2022-10-12 12:26:21 -03:00
|
|
|
# import logging registers "atfork" functions which keep indirectly the
|
|
|
|
# logging module dictionary alive. Mock the function to be able to unload
|
|
|
|
# cleanly the logging module.
|
|
|
|
@import_helper.mock_register_at_fork
|
|
|
|
def test_sundry(self, mock_os):
|
2023-08-03 03:36:02 -03:00
|
|
|
for fn in os.listdir(scriptsdir):
|
|
|
|
if not fn.endswith('.py'):
|
|
|
|
continue
|
|
|
|
name = fn[:-3]
|
|
|
|
import_tool(name)
|
2014-07-16 16:26:09 -03:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|