fix: Correct test to use del for index-based removal

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 <noreply@anthropic.com>
This commit is contained in:
John McCardle 2025-11-26 09:48:05 -05:00
parent f041a0c8ca
commit 9028bf485e
1 changed files with 2 additions and 2 deletions

View File

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