Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-08-09 10:42:03 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-08-09 10:42:03 +0300
commit2190c0c7e52827a80a4b9bab00615bd21ca6c8dd (patch)
tree38b3067334e36571eb9929f1b2b4d63377ae1f6e /tests/python
parentf2728939df31dba0e243a1657afa5c1682cccc32 (diff)
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.
Diffstat (limited to 'tests/python')
-rw-r--r--tests/python/bl_load_py_modules.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py
index 7ffececd1d9..2d8a908406f 100644
--- a/tests/python/bl_load_py_modules.py
+++ b/tests/python/bl_load_py_modules.py
@@ -123,6 +123,8 @@ def load_addons():
def load_modules():
+ VERBOSE = os.environ.get("BLENDER_VERBOSE") is not None
+
modules = []
module_paths = []
@@ -162,6 +164,14 @@ def load_modules():
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
for m in modules:
filepath = m.__file__
@@ -199,7 +209,14 @@ def load_modules():
# import failure.
# - We want to catch all failures of this script instead of stopping on
# 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
@@ -218,14 +235,6 @@ def load_modules():
for f in loaded_files:
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 ignore in ignore_paths:
if ignore in f: