From 3d2408fb4eed6cd9314391777a143ec0545ea1be Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 5 Sep 2024 14:16:09 +0200 Subject: [PATCH] Tests: blendfile versioning: print loaded file/linked ID by default. This makes the logs fairly verbose, but it is not displayed by default anyway, and it is the only easy way to find out exactly which file or ID is breaking the test. --- tests/python/bl_blendfile_versioning.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/python/bl_blendfile_versioning.py b/tests/python/bl_blendfile_versioning.py index 49c2892ba56..f76c712f7a3 100644 --- a/tests/python/bl_blendfile_versioning.py +++ b/tests/python/bl_blendfile_versioning.py @@ -108,18 +108,25 @@ class TestBlendFileOpenAllTestFiles(TestHelper): for bfp in self.blendfile_paths: if self.skip_path_check(bfp): continue + if not self.args.is_quiet: + print(f"Trying to open {bfp}") bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) bpy.ops.wm.open_mainfile(filepath=bfp, load_ui=False) def link_append(self, do_link): + operation_name = "link" if do_link else "append" for bfp in self.blendfile_paths: if self.skip_path_check(bfp): continue bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) with bpy.data.libraries.load(bfp, link=do_link) as (lib_in, lib_out): if len(lib_in.collections): + if not self.args.is_quiet: + print(f"Trying to {operation_name} {bfp}/Collection/{lib_in.collections[0]}") lib_out.collections.append(lib_in.collections[0]) elif len(lib_in.objects): + if not self.args.is_quiet: + print(f"Trying to {operation_name} {bfp}/Object/{lib_in.objects[0]}") lib_out.objects.append(lib_in.objects[0]) def test_link(self): @@ -149,6 +156,15 @@ def argparse_create(): required=False, ) + parser.add_argument( + "--quiet", + dest="is_quiet", + type=bool, + default=False, + help="Whether to quiet prints of all blendfile read/link attempts", + required=False, + ) + parser.add_argument( "--slice-range", dest="slice_range",