[Erp5-report] r38417 seb - in /erp5/trunk/products/ERP5Type: Tool/ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 16 15:38:21 CEST 2010


Author: seb
Date: Thu Sep 16 15:38:15 2010
New Revision: 38417

URL: http://svn.erp5.org?rev=38417&view=rev
Log:
add verbose option to runLiveTest

Modified:
    erp5/trunk/products/ERP5Type/Tool/ClassTool.py
    erp5/trunk/products/ERP5Type/tests/ERP5TypeLiveTestCase.py

Modified: erp5/trunk/products/ERP5Type/Tool/ClassTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/ClassTool.py?rev=38417&r1=38416&r2=38417&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/ClassTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/ClassTool.py [utf8] Thu Sep 16 15:38:15 2010
@@ -1187,7 +1187,8 @@ def initialize( context ):
                              instance_home=self._v_instance_home.getPath())
 
       security.declareProtected(Permissions.ManagePortal, 'runLiveTest')
-      def runLiveTest(self, test_list=[], run_only=None, debug=None):
+      def runLiveTest(self, test_list=[], run_only=None, debug=None,
+                      verbose=False):
         """
         Launch live tests
 
@@ -1195,9 +1196,12 @@ def initialize( context ):
                              commas (e.g. testFoo,testBar). This can be regular
                              expressions.
         debug=boolean        Invoke debugger on errors / failures.
+        verbose=boolean      Display more informations when running tests
         """
         path = os.path.join(getConfiguration().instancehome, 'tests')
-        return runLiveTest(test_list, run_only=run_only, debug=debug, path=path)
+        verbosity = verbose and 2 or 1
+        return runLiveTest(test_list, run_only=run_only, debug=debug, path=path,
+                           verbosity=verbosity)
 
       def getProductList(self):
         """ List all products """

Modified: erp5/trunk/products/ERP5Type/tests/ERP5TypeLiveTestCase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/ERP5TypeLiveTestCase.py?rev=38417&r1=38416&r2=38417&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/ERP5TypeLiveTestCase.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/ERP5TypeLiveTestCase.py [utf8] Thu Sep 16 15:38:15 2010
@@ -444,7 +444,7 @@ class ERP5TypeLiveTestCase(ProcessingNod
 
         return ResponseWrapper(response, outstream, path)
 
-def runLiveTest(test_list, **kw):
+def runLiveTest(test_list, verbosity=1, **kw):
   from Products.ERP5Type.tests.runUnitTest import DebugTestResult
   from Products.ERP5Type.tests.runUnitTest import ERP5TypeTestLoader
   from Products.ERP5Type.tests import backportUnittest
@@ -475,6 +475,6 @@ def runLiveTest(test_list, **kw):
   stream = StringIO()
   output = StringIO()
   output.write("**Running Live Test:\n")
-  result = TestRunner(stream=stream).run(suite)
+  result = TestRunner(stream=output, verbosity=verbosity).run(suite)
   output.write(stream.getvalue())
   return output.getvalue()




More information about the Erp5-report mailing list