Sanity check for xfail(strict=True): a failing test should behave exactly like a normal xfail.
(self, pytester: Pytester)
| 611 | result.stdout.fnmatch_lines([matchline]) |
| 612 | |
| 613 | def test_strict_sanity(self, pytester: Pytester) -> None: |
| 614 | """Sanity check for xfail(strict=True): a failing test should behave |
| 615 | exactly like a normal xfail.""" |
| 616 | p = pytester.makepyfile( |
| 617 | """ |
| 618 | import pytest |
| 619 | @pytest.mark.xfail(reason='unsupported feature', strict=True) |
| 620 | def test_foo(): |
| 621 | assert 0 |
| 622 | """ |
| 623 | ) |
| 624 | result = pytester.runpytest(p, "-rxX") |
| 625 | result.stdout.fnmatch_lines(["*XFAIL*", "*unsupported feature*"]) |
| 626 | assert result.ret == 0 |
| 627 | |
| 628 | @pytest.mark.parametrize("strict", [True, False]) |
| 629 | def test_strict_xfail(self, pytester: Pytester, strict: bool) -> None: |
nothing calls this directly
no test coverage detected