[Erp5-report] r29601 - /erp5/trunk/products/ERP5Type/tests/runUnitTest.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 13 15:33:15 CEST 2009


Author: nicolas.dumazet
Date: Tue Oct 13 15:33:13 2009
New Revision: 29601

URL: http://svn.erp5.org?rev=29601&view=rev
Log:
Wrap runUnitTest when used from a buildout.
This is needed to run Unit tests using TemplateTool

Modified:
    erp5/trunk/products/ERP5Type/tests/runUnitTest.py

Modified: erp5/trunk/products/ERP5Type/tests/runUnitTest.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/runUnitTest.py?rev=29601&r1=29600&r2=29601&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] Tue Oct 13 15:33:13 2009
@@ -71,7 +71,13 @@
 def getUnitTestFile():
   """returns the absolute path of this script.
   This is used by template tool to run unit tests."""
-  return os.path.abspath(__file__)
+  # ERP5_TEST_RUNNER is set when the instance was created by a buildout
+  # It should point to a wrapper to this script setting up the necessary paths
+  test_runner = os.environ.get('ERP5_TEST_RUNNER')
+  if test_runner is not None and os.path.exists(test_runner):
+    return test_runner
+  else:
+    return os.path.abspath(__file__)
 
 
 def initializeInstanceHome(tests_framework_home,




More information about the Erp5-report mailing list