From b10e5ad4d617c5f257faf48752ef6db01c078f00 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 10 Nov 2025 16:17:19 +0500 Subject: [PATCH] PanelSpy - target not all callables Because sometimes we have `Data` classes as panel attributes and they're also callable. --- src/bonsai/test/bim/test_feature.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bonsai/test/bim/test_feature.py b/src/bonsai/test/bim/test_feature.py index 28b910b3cb..4e41e4fb8e 100644 --- a/src/bonsai/test/bim/test_feature.py +++ b/src/bonsai/test/bim/test_feature.py @@ -18,6 +18,7 @@ from __future__ import annotations import os +import types import bpy import pytest import traceback @@ -81,7 +82,8 @@ class PanelSpy: return self sentinel = object() attr_value = getattr(self.blender_panel, attr, sentinel) - if attr_value is not sentinel and not callable(attr_value): + # Don't use `callable`, because we might have `Data` classes as panel attributes. + if attr_value is not sentinel and not isinstance(attr_value, types.FunctionType): return attr_value return self