MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_xfail_imperative

Method test_xfail_imperative

testing/test_skipping.py:481–494  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected