diff --git a/product/ERP5Type/Tool/ClassTool.py b/product/ERP5Type/Tool/ClassTool.py index aef429bebe0226152ed52791f7f2098c6a529300..79a4ceb000d2d5a35430a29a6fe964a34ecd93e3 100644 --- a/product/ERP5Type/Tool/ClassTool.py +++ b/product/ERP5Type/Tool/ClassTool.py @@ -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 """ diff --git a/product/ERP5Type/tests/ERP5TypeLiveTestCase.py b/product/ERP5Type/tests/ERP5TypeLiveTestCase.py index 22e7decc08a445a6a6cfeff738edd3283f9901be..169b7353dd52eb293b5348ed3711febec8503921 100644 --- a/product/ERP5Type/tests/ERP5TypeLiveTestCase.py +++ b/product/ERP5Type/tests/ERP5TypeLiveTestCase.py @@ -444,7 +444,7 @@ class ERP5TypeLiveTestCase(ProcessingNodeTestCase, PortalTestCase): 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()