Commit fff173fb authored by Jérome Perrin's avatar Jérome Perrin

When running functional tests, custom_zodb.py is in the instance home, so

from there we cannot import runUnitTest using relative import, so import it from
its full path instead, and to prevent reloading runUnitTest (which has some
import side effects) in such case, we insert it in sys module.
Original patch from jm



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35098 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6144a38
......@@ -6,7 +6,7 @@ import ZODB
from ZODB.DemoStorage import DemoStorage
from ZODB.FileStorage import FileStorage
from Products.ERP5Type.tests.utils import getMySQLArguments
from runUnitTest import instance_home, static_dir_list
from Products.ERP5Type.tests.runUnitTest import instance_home, static_dir_list
def _print(message):
sys.stderr.write(message + "\n")
......
......@@ -106,6 +106,13 @@ Options:
"""
# This script is usually executed directly, and is also imported using its full
# doted name from other locations, such as custom_zodb.py . To prevent
# reloading this module in such case, we store it in sys.modules under that
# name.
sys.modules['Products.ERP5Type.tests.runUnitTest'] = sys.modules[__name__]
static_dir_list = 'Constraint', 'Document', 'Extensions', 'PropertySheet'
def getUnitTestFile():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment