Skip to content

Commit 9211e42

Browse files
committed
Resolve pylint R1729 by using generator in any()
Replaced list comprehension with a generator expression in the `any()` call to address the `use-a-generator / R1729` pylint warning. This improves efficiency by avoiding creation of an intermediate list.
1 parent 63faacc commit 9211e42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_pyodide/hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def pytest_collection_modifyitems(items: list[Any]) -> None:
299299
def _get_item_position(item):
300300
counter[0] += 1
301301
if any(
302-
[re.match(r"^safari[\-$]?", el) for el in item.keywords._markers.keys()]
302+
re.match(r"^safari[\-$]?", el) for el in item.keywords._markers.keys()
303303
) and _has_standalone_fixture(item):
304304
return counter[0] - OFFSET
305305
return counter[0]

0 commit comments

Comments
 (0)