1 """Usage: python test.py [module(s) ...]
3 When called without optional module names, run the doctests from *all*
4 modules. This may raise lots of errors if you haven't installed one
5 of the versioning control systems.
7 When called with module name arguments, only run the doctests from
11 from libbe import plugin
16 suite = unittest.TestSuite()
19 for submodname in sys.argv[1:]:
21 mod = plugin.get_plugin("libbe", submodname)
23 if hasattr(mod, "suite"):
24 suite.addTest(mod.suite)
27 print "Module \"%s\" has no test suite" % submodname
28 mod = plugin.get_plugin("becommands", submodname)
30 suite.addTest(doctest.DocTestSuite(mod))
33 print "No modules match \"%s\"" % submodname
37 for modname,module in plugin.iter_plugins("libbe"):
38 if not hasattr(module, "suite"):
40 suite.addTest(module.suite)
41 for modname,module in plugin.iter_plugins("becommands"):
42 suite.addTest(doctest.DocTestSuite(module))
44 #for s in suite._tests:
47 result = unittest.TextTestRunner(verbosity=2).run(suite)
49 numErrors = len(result.errors)
50 numFailures = len(result.failures)
51 numBad = numErrors + numFailures