1 # Copyright (c) 2009 Jonathan M. Lange. See LICENSE for details.
3 """python -m testtools.run testspec [testspec...]
5 Run some tests with the testtools extended API.
7 For instance, to run the testtools test suite.
8 $ python -m testtools.run testtools.tests.test_suite
13 from testtools.tests import test_suite
14 from testtools import TextTestResult
17 class TestToolsTestRunner(object):
18 """ A thunk object to support unittest.TestProgram."""
21 "Run the given test case or test suite."
22 result = TextTestResult(sys.stdout)
25 return test.run(result)
30 if __name__ == '__main__':
32 from unittest import TestProgram
33 parser = optparse.OptionParser(__doc__)
34 args = parser.parse_args()[1]
36 parser.error("No testspecs given.")
37 runner = TestToolsTestRunner()
38 program = TestProgram(module=None, argv=[sys.argv[0]] + args,