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

Method _match_lines_random

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

Source from the content-addressed store, hash-verified

1562 self._match_lines_random(lines2, lambda name, pat: bool(re.match(pat, name)))
1563
1564 def _match_lines_random(
1565 self, lines2: Sequence[str], match_func: Callable[[str, str], bool]
1566 ) -> None:
1567 __tracebackhide__ = True
1568 lines2 = self._getlines(lines2)
1569 for line in lines2:
1570 for x in self.lines:
1571 if line == x or match_func(x, line):
1572 self._log("matched: ", repr(line))
1573 break
1574 else:
1575 msg = "line %r not found in output" % line
1576 self._log(msg)
1577 self._fail(msg)
1578
1579 def get_lines_after(self, fnline: str) -> Sequence[str]:
1580 """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