()
| 498 | |
| 499 | |
| 500 | def test_linematcher_match_failure() -> None: |
| 501 | lm = LineMatcher(["foo", "foo", "bar"]) |
| 502 | with pytest.raises(pytest.fail.Exception) as e: |
| 503 | lm.fnmatch_lines(["foo", "f*", "baz"]) |
| 504 | assert e.value.msg is not None |
| 505 | assert e.value.msg.splitlines() == [ |
| 506 | "exact match: 'foo'", |
| 507 | "fnmatch: 'f*'", |
| 508 | " with: 'foo'", |
| 509 | "nomatch: 'baz'", |
| 510 | " and: 'bar'", |
| 511 | "remains unmatched: 'baz'", |
| 512 | ] |
| 513 | |
| 514 | lm = LineMatcher(["foo", "foo", "bar"]) |
| 515 | with pytest.raises(pytest.fail.Exception) as e: |
| 516 | lm.re_match_lines(["foo", "^f.*", "baz"]) |
| 517 | assert e.value.msg is not None |
| 518 | assert e.value.msg.splitlines() == [ |
| 519 | "exact match: 'foo'", |
| 520 | "re.match: '^f.*'", |
| 521 | " with: 'foo'", |
| 522 | " nomatch: 'baz'", |
| 523 | " and: 'bar'", |
| 524 | "remains unmatched: 'baz'", |
| 525 | ] |
| 526 | |
| 527 | |
| 528 | def test_linematcher_consecutive() -> None: |
nothing calls this directly
no test coverage detected