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

Function _match_pattern

src/_pytest/raises.py:295–297  ·  view source on GitHub ↗

Helper function to remove redundant `re.compile` calls when printing regex

(match: Pattern[str])

Source from the content-addressed store, hash-verified

293
294
295def _match_pattern(match: Pattern[str]) -> str | Pattern[str]:
296 """Helper function to remove redundant `re.compile` calls when printing regex"""
297 return match.pattern if match.flags == _REGEX_NO_FLAGS else match
298
299
300def repr_callable(fun: Callable[[BaseExcT_1], bool]) -> str:

Callers 4

_check_matchMethod · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
matchesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected