MCPcopy Create free account
hub / github.com/pytest-dev/pytest / evaluate

Method evaluate

src/_pytest/mark/expression.py:215–225  ·  view source on GitHub ↗

Evaluate the match expression. :param matcher: Given an identifier, should return whether it matches or not. Should be prepared to handle arbitrary strings as input. :returns: Whether the expression matches or not.

(self, matcher: Callable[[str], bool])

Source from the content-addressed store, hash-verified

213 return Expression(code)
214
215 def evaluate(self, matcher: Callable[[str], bool]) -> bool:
216 """Evaluate the match expression.
217
218 :param matcher:
219 Given an identifier, should return whether it matches or not.
220 Should be prepared to handle arbitrary strings as input.
221
222 :returns: Whether the expression matches or not.
223 """
224 ret: bool = eval(self.code, {"__builtins__": {}}, MatcherAdapter(matcher))
225 return ret

Callers 3

deselect_by_keywordFunction · 0.80
deselect_by_markFunction · 0.80
evaluateFunction · 0.80

Calls 1

MatcherAdapterClass · 0.85

Tested by 1

evaluateFunction · 0.64