()
| 508 | |
| 509 | |
| 510 | def test_linematcher_match_failure() -> None: |
| 511 | lm = LineMatcher(["foo", "foo", "bar"]) |
| 512 | with pytest.raises(pytest.fail.Exception) as e: |
| 513 | lm.fnmatch_lines(["foo", "f*", "baz"]) |
| 514 | assert e.value.msg is not None |
| 515 | assert e.value.msg.splitlines() == [ |
| 516 | "exact match: 'foo'", |
| 517 | "fnmatch: 'f*'", |
| 518 | " with: 'foo'", |
| 519 | "nomatch: 'baz'", |
| 520 | " and: 'bar'", |
| 521 | "remains unmatched: 'baz'", |
| 522 | ] |
| 523 | |
| 524 | lm = LineMatcher(["foo", "foo", "bar"]) |
| 525 | with pytest.raises(pytest.fail.Exception) as e: |
| 526 | lm.re_match_lines(["foo", "^f.*", "baz"]) |
| 527 | assert e.value.msg is not None |
| 528 | assert e.value.msg.splitlines() == [ |
| 529 | "exact match: 'foo'", |
| 530 | "re.match: '^f.*'", |
| 531 | " with: 'foo'", |
| 532 | " nomatch: 'baz'", |
| 533 | " and: 'bar'", |
| 534 | "remains unmatched: 'baz'", |
| 535 | ] |
| 536 | |
| 537 | |
| 538 | def test_linematcher_consecutive() -> None: |
nothing calls this directly
no test coverage detected