()
| 526 | |
| 527 | |
| 528 | def test_linematcher_consecutive() -> None: |
| 529 | lm = LineMatcher(["1", "", "2"]) |
| 530 | with pytest.raises(pytest.fail.Exception) as excinfo: |
| 531 | lm.fnmatch_lines(["1", "2"], consecutive=True) |
| 532 | assert str(excinfo.value).splitlines() == [ |
| 533 | "exact match: '1'", |
| 534 | "no consecutive match: '2'", |
| 535 | " with: ''", |
| 536 | ] |
| 537 | |
| 538 | lm.re_match_lines(["1", r"\d?", "2"], consecutive=True) |
| 539 | with pytest.raises(pytest.fail.Exception) as excinfo: |
| 540 | lm.re_match_lines(["1", r"\d", "2"], consecutive=True) |
| 541 | assert str(excinfo.value).splitlines() == [ |
| 542 | "exact match: '1'", |
| 543 | r"no consecutive match: '\\d'", |
| 544 | " with: ''", |
| 545 | ] |
| 546 | |
| 547 | |
| 548 | @pytest.mark.parametrize("function", ["no_fnmatch_line", "no_re_match_line"]) |
nothing calls this directly
no test coverage detected