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.
This commit is contained in:
Campbell Barton 2023-07-25 21:14:50 +10:00
parent b248295530
commit 932a85a24f
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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):