fix try to fix runbot oe command

bzr revid: al@openerp.com-20140209022520-p55nlctjru58ans5
This commit is contained in:
Antony Lesuisse 2014-02-09 03:25:20 +01:00
parent 002ac937c1
commit bd16076431
2 changed files with 6 additions and 18 deletions

View File

@ -323,24 +323,8 @@ def adapt_version(version):
return version
def get_test_modules(module):
""" Return a list of module for the addons potentialy containing tests to
feed unittest2.TestLoader.loadTestsFromModule() """
# Try to import the module
module = 'openerp.addons.' + module + '.tests'
try:
m = __import__(module)
except Exception, e:
# If module has no `tests` sub-module, no problem.
if str(e) != 'No module named tests':
_logger.exception('Can not `import %s`.', module)
return []
# include submodules too
result = []
for name in sys.modules:
if name.startswith(module) and sys.modules[name]:
result.append(sys.modules[name])
return result
# backward compatibility for oe
return []
# Use a custom stream object to log the test executions.
class TestStream(object):

View File

@ -22,6 +22,8 @@ def install_openerp(database_name, create_database_flag, module_names, install_d
# Install the import hook, to import openerp.addons.<module>.
openerp.modules.module.initialize_sys_path()
print
registry = openerp.modules.registry.RegistryManager.get(
database_name, update_module=True, force_demo=install_demo_data)
@ -88,6 +90,8 @@ def run(args):
args.addons = []
config['addons_path'] = ','.join(args.addons)
print "MY addons path is", config['addons_path']
if args.all_modules:
module_names = common.get_addons_from_paths(args.addons, args.exclude)
elif args.module: