forked from bartvdbraak/blender
Python module test: Don't cfail the test when import failure happens in preset
This commit is contained in:
parent
d1dc5e0a53
commit
35d9f68121
@ -178,6 +178,7 @@ def load_modules():
|
||||
for f in MODULE_SYS_PATHS.get(mod_name_full, ())
|
||||
])
|
||||
|
||||
try:
|
||||
__import__(mod_name_full)
|
||||
mod_imp = sys.modules[mod_name_full]
|
||||
|
||||
@ -187,6 +188,18 @@ def load_modules():
|
||||
assert(os.path.samefile(mod_imp.__file__, submod_full))
|
||||
|
||||
modules.append(mod_imp)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
# Module might fail to import, but we don't want whole test to fail here.
|
||||
# Reasoning:
|
||||
# - This module might be in ignored list (for example, preset or template),
|
||||
# so failing here will cause false-positive test failure.
|
||||
# - If this is module which should not be ignored, it is not added to list
|
||||
# of successfully loaded modules, meaning the test will catch this
|
||||
# import failure.
|
||||
# - We want to catch all failures of this script instead of stopping on
|
||||
# a first big failure.
|
||||
traceback.print_exc()
|
||||
|
||||
#
|
||||
# check which filepaths we didn't load
|
||||
|
Loading…
Reference in New Issue
Block a user