Adjusted be-mbox-to-xml to not drop author info from multipart messages
[be.git] / test.py
diff --git a/test.py b/test.py
index 1f1ffcfd804889b85ce17932f4e80485420e2140..4f20808b326ad1c078e5dd28c1d49fd8524e9033 100644 (file)
--- a/test.py
+++ b/test.py
@@ -8,7 +8,9 @@ When called with module name arguments, only run the doctests from
 those modules.
 """
 
-from libbe import plugin
+import libbe
+libbe.TESTING = True
+from libbe import plugin, vcs
 import unittest
 import doctest
 import sys
@@ -27,7 +29,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
@@ -41,9 +46,10 @@ else:
     for modname,module in plugin.iter_plugins("becommands"):
         suite.addTest(doctest.DocTestSuite(module))
 
-#for s in suite._tests:
-#    print s
-#exit(0)
+_vcs = vcs.installed_vcs()
+vcs.set_preferred_vcs(_vcs.name)
+print 'Using %s as the testing VCS' % _vcs.name
+
 result = unittest.TextTestRunner(verbosity=2).run(suite)
 
 numErrors = len(result.errors)