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

Method _match_lines_random

src/_pytest/pytester.py:1611–1624  ·  view source on GitHub ↗
(
        self, lines2: Sequence[str], match_func: Callable[[str, str], bool]
    )

Source from the content-addressed store, hash-verified

1609 self._match_lines_random(lines2, lambda name, pat: bool(re.match(pat, name)))
1610
1611 def _match_lines_random(
1612 self, lines2: Sequence[str], match_func: Callable[[str, str], bool]
1613 ) -> None:
1614 __tracebackhide__ = True
1615 lines2 = self._getlines(lines2)
1616 for line in lines2:
1617 for x in self.lines:
1618 if line == x or match_func(x, line):
1619 self._log("matched: ", repr(line))
1620 break
1621 else:
1622 msg = f"line {line!r} not found in output"
1623 self._log(msg)
1624 self._fail(msg)
1625
1626 def get_lines_after(self, fnline: str) -> Sequence[str]:
1627 """Return all lines following the given line in the text.

Callers 2

fnmatch_lines_randomMethod · 0.95
re_match_lines_randomMethod · 0.95

Calls 3

_getlinesMethod · 0.95
_logMethod · 0.95
_failMethod · 0.95

Tested by

no test coverage detected