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

Method fnmatch_lines

src/_pytest/pytester.py:1643–1656  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1641 return "\n".join(self._log_output)
1642
1643 def fnmatch_lines(
1644 self, lines2: Sequence[str], *, consecutive: bool = False
1645 ) -> None:
1646 """Check lines exist in the output (using :func:`python:fnmatch.fnmatch`).
1647
1648 The argument is a list of lines which have to match and can use glob
1649 wildcards. If they do not match a pytest.fail() is called. The
1650 matches and non-matches are also shown as part of the error message.
1651
1652 :param lines2: String patterns to match.
1653 :param consecutive: Match lines consecutively?
1654 """
1655 __tracebackhide__ = True
1656 self._match_lines(lines2, fnmatch, "fnmatch", consecutive=consecutive)
1657
1658 def re_match_lines(
1659 self, lines2: Sequence[str], *, consecutive: bool = False

Calls 1

_match_linesMethod · 0.95

Tested by

no test coverage detected