aboutsummaryrefslogtreecommitdiffstats
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test.py b/test.py
index 2b93bcf..fecff8c 100644
--- a/test.py
+++ b/test.py
@@ -1,3 +1,5 @@
+# Copyright
+
"""Usage: python test.py [module(s) ...]
When called without optional module names, run the test suites for
@@ -49,14 +51,14 @@ def python_tree(root_path='libbe', root_modname='libbe'):
f.parent.append(f)
return tree
-def add_module_tests(suite, module_name):
- mod = import_by_name(module_name)
- if mod == None:
- raise KeyError, 'module "%s" not found' % module_name
+def add_module_tests(suite, modname):
+ mod = import_by_name(modname)
if hasattr(mod, 'suite'):
s = mod.suite
else:
s = unittest.TestLoader().loadTestsFromModule(mod)
+ sdoc = doctest.DocTestSuite(mod)
+ suite.addTest(sdoc)
suite.addTest(s)
suite = unittest.TestSuite()