mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix RUF015 (next() instead of list comprehensions[0])
https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
This commit is contained in:
@@ -81,8 +81,8 @@ class TestGetReferences(test.bootstrap.IFC4):
|
||||
reference=reference2,
|
||||
classification=classification,
|
||||
)
|
||||
reference1 = [r for r in self.file.by_type("IfcClassificationReference") if r.Identification == "1"][0]
|
||||
reference2 = [r for r in self.file.by_type("IfcClassificationReference") if r.Identification == "2"][0]
|
||||
reference1 = next(r for r in self.file.by_type("IfcClassificationReference") if r.Identification == "1")
|
||||
reference2 = next(r for r in self.file.by_type("IfcClassificationReference") if r.Identification == "2")
|
||||
assert subject.get_references(element_type) == set([reference2])
|
||||
assert subject.get_references(element) == set([reference1])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user