MCPcopy
hub / github.com/pytest-dev/pytest / MatcherAdapter

Class MatcherAdapter

src/_pytest/mark/expression.py:294–307  ·  view source on GitHub ↗

Adapts a matcher function to a locals mapping as required by eval().

Source from the content-addressed store, hash-verified

292
293
294class MatcherAdapter(Mapping[str, MatcherNameAdapter]):
295 """Adapts a matcher function to a locals mapping as required by eval()."""
296
297 def __init__(self, matcher: ExpressionMatcher) -> None:
298 self.matcher = matcher
299
300 def __getitem__(self, key: str) -> MatcherNameAdapter:
301 return MatcherNameAdapter(matcher=self.matcher, name=key[len(IDENT_PREFIX) :])
302
303 def __iter__(self) -> Iterator[str]:
304 raise NotImplementedError()
305
306 def __len__(self) -> int:
307 raise NotImplementedError()
308
309
310@final

Callers 1

evaluateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected