[Bf-blender-cvs] [6cf3fa9ff0b] blender2.8: Tests: import blendfile without modifying sys.path
Sybren A. Stüvel
noreply at git.blender.org
Fri Apr 7 17:31:09 CEST 2017
Commit: 6cf3fa9ff0b697dc9efeec8578e3341434b6a9ce
Author: Sybren A. Stüvel
Date: Fri Apr 7 17:25:09 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB6cf3fa9ff0b697dc9efeec8578e3341434b6a9ce
Tests: import blendfile without modifying sys.path
===================================================================
M tests/python/render_layer/render_layer_common.py
===================================================================
diff --git a/tests/python/render_layer/render_layer_common.py b/tests/python/render_layer/render_layer_common.py
index e1785dbd084..645b111b49c 100644
--- a/tests/python/render_layer/render_layer_common.py
+++ b/tests/python/render_layer/render_layer_common.py
@@ -122,7 +122,8 @@ def get_scene_collections(scene):
def query_scene(filepath, name, callbacks):
"""Return the equivalent to bpy.context.scene"""
- import blendfile
+ from io_blend_utils.blend import blendfile
+
with blendfile.open_blend(filepath) as blend:
scenes = [block for block in blend.blocks if block.code == b'SC']
for scene in scenes:
@@ -137,22 +138,6 @@ def query_scene(filepath, name, callbacks):
# Utils
# ############################################################
-def import_blendfile():
- import bpy
- import os
- import sys
- path = os.path.join(
- bpy.utils.resource_path('LOCAL'),
- 'scripts',
- 'addons',
- 'io_blend_utils',
- 'blend',
- )
-
- if path not in sys.path:
- sys.path.append(path)
-
-
def dump(data):
import json
return json.dumps(
@@ -199,7 +184,6 @@ class RenderLayerTesting(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""Runs once"""
- cls.pretest_import_blendfile()
cls.pretest_parsing()
@classmethod
@@ -225,15 +209,6 @@ class RenderLayerTesting(unittest.TestCase):
root = cls.get_root()
cls.assertTrue(root, "Testdir not set")
- @staticmethod
- def pretest_import_blendfile():
- """
- Make sure blendfile imports with no problems
- name has extra _ because we need this test to run first
- """
- import_blendfile()
- import blendfile
-
def setUp(self):
"""Runs once per test"""
import bpy
More information about the Bf-blender-cvs
mailing list