Fix RUF015 (next() instead of list comprehensions[0])

https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
This commit is contained in:
Andrej730
2025-06-16 12:29:41 +05:00
parent b486b32c8d
commit a12bb343ca
29 changed files with 64 additions and 61 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ class TestAddClassificationReferenceFromBSDD(NewFile):
bpy.ops.bim.add_classification_reference_from_bsdd(obj="IfcSpace/Cube", obj_type="Object")
refs = ifcopenshell.util.classification.get_references(element)
assert len(refs) == 1
assert list(refs)[0].Location.startswith(uri)
assert next(iter(refs)).Location.startswith(uri)
def test_add_classification_refence_with_props(self):
bpy.ops.bim.create_project()
@@ -92,7 +92,7 @@ class TestAddClassificationReferenceFromBSDD(NewFile):
assert pset and pset["Handicap Accessible"] == True
refs = ifcopenshell.util.classification.get_references(element)
assert len(refs) == 1
assert list(refs)[0].Location.startswith(uri)
assert next(iter(refs)).Location.startswith(uri)
def test_add_clasification_reference_with_object_type(self):
bpy.ops.bim.create_project()