Skip to content

Commit c26bbdf

Browse files
authored
Merge pull request #6854 from gdhameeja/Fix-6822
Check invalid operations for -k
2 parents e2dc2d1 + 599bf07 commit c26bbdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/mark/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ def matchkeyword(colitem, keywordexpr):
112112
)
113113
try:
114114
return eval(keywordexpr, {}, mapping)
115-
except SyntaxError:
115+
except Exception:
116116
raise UsageError("Wrong expression passed to '-k': {}".format(keywordexpr))

0 commit comments

Comments
 (0)