test.py now uses unittest.TestSuite 'suite' in becommands if present.
authorW. Trevor King <wking@drexel.edu>
Sun, 29 Nov 2009 01:27:53 +0000 (20:27 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 29 Nov 2009 01:27:53 +0000 (20:27 -0500)
Such 'suite' instances have been required for libbe submodules.  This
will allow becommands to test themselves more thoroughly than they
could with only doctests.

test.py

diff --git a/test.py b/test.py
index 57091c79ca7be177f830b46193febf0275640335..81674cf49ff473a241e4ed7f0781f8ebede8dacc 100644 (file)
--- a/test.py
+++ b/test.py
@@ -27,7 +27,10 @@ if len(sys.argv) > 1:
                 print "Module \"%s\" has no test suite" % submodname
         mod = plugin.get_plugin("becommands", submodname)
         if mod is not None:
-            suite.addTest(doctest.DocTestSuite(mod))
+            if hasattr(mod, "suite"):
+                suite.addTest(mod.suite)
+            else:
+                suite.addTest(doctest.DocTestSuite(mod))
             match = True
         if not match:
             print "No modules match \"%s\"" % submodname