From 8c0bed0c614800d3bf118ec35ae24a76b3fd3a92 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 16 Feb 2026 18:24:37 +1100 Subject: [PATCH] Stub open command so running tests doesn't keep on launching apps --- src/bonsai/bonsai/bim/module/drawing/operator.py | 1 + src/bonsai/test/bim/bootstrap.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index db389427e6..2f858a9d9e 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -3165,6 +3165,7 @@ class EditTextPopup(bpy.types.Operator): bpy.ops.bim.disable_editing_text() def execute(self, context): + # TODO: check for possible subtle undo bug here # can't use invoke() because this operator # will be run indirectly by hotkey # so we use execute() and track whether it's the first run of the operator diff --git a/src/bonsai/test/bim/bootstrap.py b/src/bonsai/test/bim/bootstrap.py index c799c74c00..587b8f5a2d 100644 --- a/src/bonsai/test/bim/bootstrap.py +++ b/src/bonsai/test/bim/bootstrap.py @@ -34,6 +34,7 @@ from bonsai.bim.ifc import IfcStore # Monkey-patch webbrowser opening since we want to test headlessly webbrowser.open = lambda x: True +tool.Drawing.open_with_user_command = lambda x, y: True variables = {"cwd": os.getcwd(), "ifc": "IfcStore.get_file()"}