From 932a85a24f020964661cbc98f3a1e2bb4bf3bfb2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Jul 2023 21:14:50 +1000 Subject: [PATCH] Fix tests failing from errors in the users startup file Tests should never depend on the users startup.blend which can have settings that interfere with tests. Failure to load the user startup.blend for e.g. prevented bl_alembic_io_test from passing. --- tests/performance/tests/blend_load.py | 2 +- tests/python/bl_alembic_io_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/performance/tests/blend_load.py b/tests/performance/tests/blend_load.py index bbadb5c9d89..f2036ea5932 100644 --- a/tests/performance/tests/blend_load.py +++ b/tests/performance/tests/blend_load.py @@ -13,7 +13,7 @@ def _run(filepath): # Load once to ensure it's cached by OS bpy.ops.wm.open_mainfile(filepath=filepath) - bpy.ops.wm.read_homefile() + bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) # Measure loading the second time start_time = time.time() diff --git a/tests/python/bl_alembic_io_test.py b/tests/python/bl_alembic_io_test.py index 6b098ab0e6c..f10a9c6f022 100644 --- a/tests/python/bl_alembic_io_test.py +++ b/tests/python/bl_alembic_io_test.py @@ -256,7 +256,7 @@ class CameraExportImportTest(unittest.TestCase): # Unload the current blend file to release the imported Alembic file. # This is necessary on Windows in order to be able to delete the # temporary ABC file. - bpy.ops.wm.read_homefile() + bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) self._tempdir.cleanup() def test_export_hierarchy(self):