diff --git a/src/_pytest/mark/legacy.py b/src/_pytest/mark/legacy.py index 651288cb8..766b8f9bd 100644 --- a/src/_pytest/mark/legacy.py +++ b/src/_pytest/mark/legacy.py @@ -63,7 +63,7 @@ class KeywordMapping: """ subname = subname.lower() - names = [name.lower() for name in self._names] + names = (name.lower() for name in self._names) for name in names: if subname in name: