(self, pytester: Pytester)
| 479 | assert result.ret == 0 |
| 480 | |
| 481 | def test_xfail_imperative(self, pytester: Pytester) -> None: |
| 482 | p = pytester.makepyfile( |
| 483 | """ |
| 484 | import pytest |
| 485 | def test_this(): |
| 486 | pytest.xfail("hello") |
| 487 | """ |
| 488 | ) |
| 489 | result = pytester.runpytest(p) |
| 490 | result.stdout.fnmatch_lines(["*1 xfailed*"]) |
| 491 | result = pytester.runpytest(p, "-rx") |
| 492 | result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*reason:*hello*"]) |
| 493 | result = pytester.runpytest(p, "--runxfail") |
| 494 | result.stdout.fnmatch_lines(["*1 pass*"]) |
| 495 | |
| 496 | def test_xfail_imperative_in_setup_function(self, pytester: Pytester) -> None: |
| 497 | p = pytester.makepyfile( |
nothing calls this directly
no test coverage detected