diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-08-09 16:08:06 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-08-09 16:08:06 +0300 |
commit | 6883f10f141d51cf2427183a85f11fd87a8915ad (patch) | |
tree | 620f7e5eaa8fdbddd9ef709e699e66ff87237413 /tests | |
parent | ed500ac8c751046c005c2988775bd745252f4939 (diff) | |
parent | 176ad9ecdd4efca4dbe33b9c3a003c16e3706433 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'tests')
-rw-r--r-- | tests/python/bl_alembic_import_test.py | 16 | ||||
-rw-r--r-- | tests/python/bl_load_py_modules.py | 27 |
2 files changed, 27 insertions, 16 deletions
diff --git a/tests/python/bl_alembic_import_test.py b/tests/python/bl_alembic_import_test.py index 9f758b0b161..65a0867d5c1 100644 --- a/tests/python/bl_alembic_import_test.py +++ b/tests/python/bl_alembic_import_test.py @@ -179,22 +179,24 @@ class SimpleImportTest(AbstractAlembicTest): res = bpy.ops.wm.alembic_import(filepath=str(abc), as_background_job=False) self.assertEqual({'FINISHED'}, res) - cube = bpy.context.active_object + plane = bpy.context.active_object # Check that the file loaded ok. bpy.context.scene.frame_set(6) - self.assertAlmostEqual(-1, cube.data.vertices[0].co.x) - self.assertAlmostEqual(-1, cube.data.vertices[0].co.y) - self.assertAlmostEqual(0.5905638933181763, cube.data.vertices[0].co.z) + mesh = plane.to_mesh(bpy.context.scene, True, 'RENDER') + self.assertAlmostEqual(-1, mesh.vertices[0].co.x) + self.assertAlmostEqual(-1, mesh.vertices[0].co.y) + self.assertAlmostEqual(0.5905638933181763, mesh.vertices[0].co.z) # Change path from absolute to relative. This should not break the animation. bpy.context.scene.frame_set(1) bpy.data.cache_files[fname].filepath = relpath bpy.context.scene.frame_set(6) - self.assertAlmostEqual(1, cube.data.vertices[3].co.x) - self.assertAlmostEqual(1, cube.data.vertices[3].co.y) - self.assertAlmostEqual(0.5905638933181763, cube.data.vertices[3].co.z) + mesh = plane.to_mesh(bpy.context.scene, True, 'RENDER') + self.assertAlmostEqual(1, mesh.vertices[3].co.x) + self.assertAlmostEqual(1, mesh.vertices[3].co.y) + self.assertAlmostEqual(0.5905638933181763, mesh.vertices[3].co.z) def test_import_long_names(self): # This file contains very long names. The longest name is 4047 chars. 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: |