Skip to content

Commit 76b8870

Browse files
[pylint consider-using-any-or-all] Fix or disable all detected issues (#12954)
* Avoid constructing a list of names * noqa a a suggestion in already nested for
1 parent 4734520 commit 76b8870

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ disable = [
213213
"condition-evals-to-constant",
214214
"consider-alternative-union-syntax",
215215
"confusing-consecutive-elif",
216-
"consider-using-any-or-all",
217216
"consider-using-assignment-expr",
218217
"consider-using-dict-items",
219218
"consider-using-from-import",

src/_pytest/mark/__init__.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,7 @@ def __call__(self, subname: str, /, **kwargs: str | int | bool | None) -> bool:
193193
if kwargs:
194194
raise UsageError("Keyword expressions do not support call parameters.")
195195
subname = subname.lower()
196-
names = (name.lower() for name in self._names)
197-
198-
for name in names:
199-
if subname in name:
200-
return True
201-
return False
196+
return any(subname in name.lower() for name in self._names)
202197

203198

204199
def deselect_by_keyword(items: list[Item], config: Config) -> None:
@@ -243,10 +238,9 @@ def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool:
243238
if not (matches := self.own_mark_name_mapping.get(name, [])):
244239
return False
245240

246-
for mark in matches:
241+
for mark in matches: # pylint: disable=consider-using-any-or-all
247242
if all(mark.kwargs.get(k, NOT_SET) == v for k, v in kwargs.items()):
248243
return True
249-
250244
return False
251245

252246

0 commit comments

Comments
 (0)