From 9028bf485ef79bef56f9c7c3def3ab77bfb99ca6 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Wed, 26 Nov 2025 09:48:05 -0500 Subject: [PATCH] fix: Correct test to use del for index-based removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was incorrectly using scene_ui.remove(-1) expecting it to remove the element at index -1. However, Python's list.remove(x) removes the first occurrence of VALUE x, not by index. Changed to use `del scene_ui[-1]` which is the correct Python idiom for removing an element by index. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tests/unit/test_python_object_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_python_object_cache.py b/tests/unit/test_python_object_cache.py index 791cca3..e7c2831 100644 --- a/tests/unit/test_python_object_cache.py +++ b/tests/unit/test_python_object_cache.py @@ -92,9 +92,9 @@ def run_tests(runtime): test(retrieved_caption.caption_id == "test_caption", "Caption custom data preserved") # Test 8: Test removal and re-addition - #scene_ui.remove(frame) # TypeError: UICollection.remove requires an integer index to remove - seems like a C++ bug in the remove() implementation + # Use del to remove by index (Python standard), or .remove(element) to remove by value print(f"before remove: {len(scene_ui)=}") - scene_ui.remove(-1) + del scene_ui[-1] # Remove last element by index print(f"after remove: {len(scene_ui)=}") scene_ui.append(frame)