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
)
| 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, |
no test coverage detected