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
path: root/tests
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-04-18 22:11:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-04-18 22:14:14 +0300
commitbd7d39f0b9671d31bb7a5ced93cd1d81b1bd4611 (patch)
treee7f38771a5193fd97a3db551b16f8868cd15de84 /tests
parent7ec6bca92fd0ee4a3b1dcdf90fdba1f9d0aec11a (diff)
PyTests: do not load addons in load_py_modules test.
It makes no sense to load add-ons here, we already do that (in a more complete way) in load_addons test, this is only adding overhead and doubling code to maintain). Also do not try to load-as-modules add-ons that are not 2.8-ready, and some other misc fix. load_py_modules test should be passing again now. Thanks to @sergey who did part of the work here as well.
Diffstat (limited to 'tests')
-rw-r--r--tests/python/bl_load_py_modules.py35
1 files changed, 7 insertions, 28 deletions
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py
index be7f426d993..3df0d6310dc 100644
--- a/tests/python/bl_load_py_modules.py
+++ b/tests/python/bl_load_py_modules.py
@@ -41,6 +41,10 @@ BLACKLIST = {
os.path.join("io_blend_utils", "blender_bam-unpacked.whl"),
}
+for mod in addon_utils.modules():
+ if addon_utils.module_bl_info(mod)['blender'] < (2, 80, 0):
+ BLACKLIST.add(mod.__name__)
+
# Some modules need to add to the `sys.path`.
MODULE_SYS_PATHS = {
# Runs in a Python subprocess, so its expected its basedir can be imported.
@@ -83,13 +87,6 @@ def module_names_all(mod_dir):
yield from module_names_recursive(mod_dir)
-def addon_modules_sorted():
- modules = addon_utils.modules({})
- modules[:] = [mod for mod in modules if not mod.__file__.startswith(BLACKLIST_DIRS)]
- modules.sort(key=lambda mod: mod.__name__)
- return modules
-
-
def source_list(path, filename_check=None):
from os.path import join
for dirpath, dirnames, filenames in os.walk(path):
@@ -102,25 +99,6 @@ def source_list(path, filename_check=None):
yield filepath
-def load_addons():
- modules = addon_modules_sorted()
- addons = bpy.context.preferences.addons
-
- # first disable all
- for mod_name in list(addons.keys()):
- addon_utils.disable(mod_name, default_set=True)
-
- assert(bool(addons) is False)
-
- for mod in modules:
- mod_name = mod.__name__
- if mod_name in BLACKLIST:
- continue
- addon_utils.enable(mod_name, default_set=True)
- if not (mod_name in addons):
- raise Exception("'addon_utils.enable(%r)' call failed" % mod_name)
-
-
def load_modules():
VERBOSE = os.environ.get("BLENDER_VERBOSE") is not None
@@ -166,7 +144,9 @@ def load_modules():
# test we tested all files except for presets and templates
ignore_paths = [
os.sep + "presets" + os.sep,
- os.sep + "templates" + os.sep,
+ os.sep + "templates_osl" + os.sep,
+ os.sep + "templates_py" + os.sep,
+ os.sep + "bl_app_templates_system" + os.sep,
] + ([(os.sep + f + os.sep) for f in BLACKLIST] +
[(os.sep + f + ".py") for f in BLACKLIST])
@@ -245,7 +225,6 @@ def load_modules():
def main():
- load_addons()
load_modules()