[ruff] Activate use next(iter(x)) instead of list(x)[0] and fix issue

This commit is contained in:
Pierre Sassoulas 2024-02-02 15:08:22 +01:00
parent 180a16a344
commit 8967c527ff
2 changed files with 1 additions and 2 deletions

View File

@ -160,7 +160,6 @@ ignore = [
# ruff ignore
"RUF005", # Consider `(x, *y)` instead of concatenation
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF015", # Prefer `next(iter(x))` over single element slice
]
[tool.ruff.format]

View File

@ -1209,7 +1209,7 @@ class TestReportInfo:
classcol = pytester.collect_by_name(modcol, "TestClass")
assert isinstance(classcol, Class)
path, lineno, msg = classcol.reportinfo()
func = list(classcol.collect())[0]
func = next(iter(classcol.collect()))
assert isinstance(func, Function)
path, lineno, msg = func.reportinfo()