diff --git a/Lib/test/test_tools.py b/Lib/test/test_tools.py new file mode 100644 --- /dev/null +++ b/Lib/test/test_tools.py @@ -0,0 +1,33 @@ +"""Tests for reindent.py.""" + +import os +import unittest +import sysconfig +from test import support +from test.script_helper import assert_python_ok + +if not sysconfig.is_python_build(): + raise unittest.SkipTest('requires an uninstalled Python build') + +srcdir = sysconfig.get_config_var('projectbase') +basepath = os.path.join(os.getcwd(), srcdir, 'Tools') + + +class ReindentTests(unittest.TestCase): + script = os.path.join(basepath, 'scripts', 'reindent.py') + + def test_noargs(self): + assert_python_ok(self.script) + + def test_help(self): + rc, out, err = assert_python_ok(self.script, '-h') + self.assertEqual(out, b'') + self.assertGreater(err, b'') + + +def test_main(): + support.run_unittest(ReindentTests) + + +if __name__ == '__main__': + unittest.main() diff --git a/Tools/parser/test_unparse.py b/Tools/parser/test_unparse.py --- a/Tools/parser/test_unparse.py +++ b/Tools/parser/test_unparse.py @@ -1,3 +1,5 @@ +# XXX move to test_tools + import unittest import test.support import io