Modules test: Don't print backtrace for files which are ignored
This could make output really polluted, where it'll be hard to see actual issues. It is still possible to have all backtraces printed using BLENDER_VERBOSE environment variable.
This commit is contained in:
@@ -123,6 +123,8 @@ def load_addons():
|
|||||||
|
|
||||||
|
|
||||||
def load_modules():
|
def load_modules():
|
||||||
|
VERBOSE = os.environ.get("BLENDER_VERBOSE") is not None
|
||||||
|
|
||||||
modules = []
|
modules = []
|
||||||
module_paths = []
|
module_paths = []
|
||||||
|
|
||||||
@@ -161,6 +163,14 @@ def load_modules():
|
|||||||
module_names[mod] = mod_dir, mod_full
|
module_names[mod] = mod_dir, mod_full
|
||||||
del module_names
|
del module_names
|
||||||
|
|
||||||
|
#
|
||||||
|
# test we tested all files except for presets and templates
|
||||||
|
ignore_paths = [
|
||||||
|
os.sep + "presets" + os.sep,
|
||||||
|
os.sep + "templates" + os.sep,
|
||||||
|
] + ([(os.sep + f + os.sep) for f in BLACKLIST] +
|
||||||
|
[(os.sep + f + ".py") for f in BLACKLIST])
|
||||||
|
|
||||||
#
|
#
|
||||||
# now submodules
|
# now submodules
|
||||||
for m in modules:
|
for m in modules:
|
||||||
@@ -199,7 +209,14 @@ def load_modules():
|
|||||||
# import failure.
|
# import failure.
|
||||||
# - We want to catch all failures of this script instead of stopping on
|
# - We want to catch all failures of this script instead of stopping on
|
||||||
# a first big failure.
|
# a first big failure.
|
||||||
traceback.print_exc()
|
do_print = True
|
||||||
|
if not VERBOSE:
|
||||||
|
for ignore in ignore_paths:
|
||||||
|
if ignore in submod_full:
|
||||||
|
do_print = False
|
||||||
|
break
|
||||||
|
if do_print:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
#
|
#
|
||||||
# check which filepaths we didn't load
|
# check which filepaths we didn't load
|
||||||
@@ -218,14 +235,6 @@ def load_modules():
|
|||||||
for f in loaded_files:
|
for f in loaded_files:
|
||||||
source_files.remove(f)
|
source_files.remove(f)
|
||||||
|
|
||||||
#
|
|
||||||
# test we tested all files except for presets and templates
|
|
||||||
ignore_paths = [
|
|
||||||
os.sep + "presets" + os.sep,
|
|
||||||
os.sep + "templates" + os.sep,
|
|
||||||
] + ([(os.sep + f + os.sep) for f in BLACKLIST] +
|
|
||||||
[(os.sep + f + ".py") for f in BLACKLIST])
|
|
||||||
|
|
||||||
for f in source_files:
|
for f in source_files:
|
||||||
for ignore in ignore_paths:
|
for ignore in ignore_paths:
|
||||||
if ignore in f:
|
if ignore in f:
|
||||||
|
Reference in New Issue
Block a user