[Bf-blender-cvs] [ef7efc37519] master: Tests: don't write thumbnails when running tests

Campbell Barton noreply at git.blender.org
Thu Mar 4 07:44:03 CET 2021


Commit: ef7efc375197e560da3c91153b21694f5bcb4a27
Author: Campbell Barton
Date:   Thu Mar 4 17:43:12 2021 +1100
Branches: master
https://developer.blender.org/rBef7efc375197e560da3c91153b21694f5bcb4a27

Tests: don't write thumbnails when running tests

Also replace WM_OT_read_factory_settings with WM_OT_read_homefile
so the preferences don't have to be reloaded.

===================================================================

M	tests/python/bl_blendfile_io.py
M	tests/python/bl_blendfile_liblink.py

===================================================================

diff --git a/tests/python/bl_blendfile_io.py b/tests/python/bl_blendfile_io.py
index 2c27b60f34e..38b3a93bbbc 100644
--- a/tests/python/bl_blendfile_io.py
+++ b/tests/python/bl_blendfile_io.py
@@ -15,7 +15,8 @@ class TestBlendFileSaveLoadBasic(TestHelper):
         self.args = args
 
     def test_save_load(self):
-        bpy.ops.wm.read_factory_settings()
+        bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
+
         bpy.data.meshes.new("OrphanedMesh")
 
         output_dir = self.args.output_dir
@@ -71,6 +72,9 @@ def argparse_create():
 def main():
     args = argparse_create().parse_args()
 
+    # Don't write thumbnails into the home directory.
+    bpy.context.preferences.filepaths.use_save_preview_images = False
+
     for Test in TESTS:
         Test(args).run_all_tests()
 
diff --git a/tests/python/bl_blendfile_liblink.py b/tests/python/bl_blendfile_liblink.py
index fc618314216..a5f2571c902 100644
--- a/tests/python/bl_blendfile_liblink.py
+++ b/tests/python/bl_blendfile_liblink.py
@@ -15,7 +15,9 @@ class TestBlendLibLinkSaveLoadBasic(TestHelper):
         self.args = args
 
     def test_link_save_load(self):
-        bpy.ops.wm.read_factory_settings()
+
+        bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
+
         me = bpy.data.meshes.new("LibMesh")
         me.use_fake_user = True
 
@@ -26,7 +28,7 @@ class TestBlendLibLinkSaveLoadBasic(TestHelper):
 
         bpy.ops.wm.save_as_mainfile(filepath=output_path, check_existing=False, compress=False)
 
-        bpy.ops.wm.read_factory_settings()
+        bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
         bpy.data.orphans_purge()
 
         link_dir = os.path.join(output_path, "Mesh")
@@ -68,6 +70,9 @@ def argparse_create():
 def main():
     args = argparse_create().parse_args()
 
+    # Don't write thumbnails into the home directory.
+    bpy.context.preferences.filepaths.use_save_preview_images = False
+
     for Test in TESTS:
         Test(args).run_all_tests()



More information about the Bf-blender-cvs mailing list