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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jun 2 17:35:53 CEST 2006


Author: alex
Date: Fri Jun  2 17:35:50 2006
New Revision: 7594

URL: http://svn.erp5.org?rev=7594&view=rev
Log:
Included $INSTANCE_HOME/lib/pyhton in sys.path when launching tests. This
allows to keep the same environment as the zope instance running at the same
location (for example, inhibiting psyco to be able to use pdb).

Added a note about the inclusion of tests_framework_home in sys.path . This
should be removed as soon as possible.

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=7594&r1=7593&r2=7594&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/runUnitTest.py (original)
+++ erp5/trunk/products/ERP5Type/tests/runUnitTest.py Fri Jun  2 17:35:50 2006
@@ -94,9 +94,14 @@
   products_home = os.path.join(instance_home, 'Products')
   from glob import glob
   product_test_list = glob(products_home + os.sep + '*' + os.sep + 'tests')
-  sys.path += product_test_list
+  sys.path.extend(product_test_list)
   sys.path.extend((real_tests_home, tests_home))
 
+  # Make sure that locally overridden python modules are used
+  sys.path.insert(0, os.path.join(real_instance_home, 'lib%spython' % os.sep))
+
+  # XXX Allowing to load modules from here is a wrong idea. use the above path
+  # instead.
   # Add tests_framework_home as first path element.
   # this allows to bypass psyco by creating a dummy psyco module
   # it is then possible to run the debugger by "import pdb; pdb.set_trace()"




More information about the Erp5-report mailing list