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

Method re_match_lines

src/_pytest/pytester.py:1658–1677  ·  view source on GitHub ↗

Check lines exist in the output (using :func:`python:re.match`). The argument is a list of lines which have to match using ``re.match``. If they do not match a pytest.fail() is called. The matches and non-matches are also shown as part of the error message. :param

(
        self, lines2: Sequence[str], *, consecutive: bool = False
    )

Source from the content-addressed store, hash-verified

1656 self._match_lines(lines2, fnmatch, "fnmatch", consecutive=consecutive)
1657
1658 def re_match_lines(
1659 self, lines2: Sequence[str], *, consecutive: bool = False
1660 ) -> None:
1661 """Check lines exist in the output (using :func:`python:re.match`).
1662
1663 The argument is a list of lines which have to match using ``re.match``.
1664 If they do not match a pytest.fail() is called.
1665
1666 The matches and non-matches are also shown as part of the error message.
1667
1668 :param lines2: string patterns to match.
1669 :param consecutive: match lines consecutively?
1670 """
1671 __tracebackhide__ = True
1672 self._match_lines(
1673 lines2,
1674 lambda name, pat: bool(re.match(pat, name)),
1675 "re.match",
1676 consecutive=consecutive,
1677 )
1678
1679 def _match_lines(
1680 self,

Callers 15

test_normalMethod · 0.80
test_colored_progressMethod · 0.80
test_countMethod · 0.80
test_timesMethod · 0.80
test_times_multilineMethod · 0.80
test_verboseMethod · 0.80
test_verbose_countMethod · 0.80
test_verbose_timesMethod · 0.80
test_xdist_normalMethod · 0.80

Calls 2

_match_linesMethod · 0.95
matchMethod · 0.80

Tested by

no test coverage detected