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

Method test_strict_xfail_condition

testing/test_skipping.py:656–669  ·  view source on GitHub ↗
(self, pytester: Pytester, strict: bool)

Source from the content-addressed store, hash-verified

654
655 @pytest.mark.parametrize("strict", [True, False])
656 def test_strict_xfail_condition(self, pytester: Pytester, strict: bool) -> None:
657 p = pytester.makepyfile(
658 """
659 import pytest
660
661 @pytest.mark.xfail(False, reason='unsupported feature', strict=%s)
662 def test_foo():
663 pass
664 """
665 % strict
666 )
667 result = pytester.runpytest(p, "-rxX")
668 result.stdout.fnmatch_lines(["*1 passed*"])
669 assert result.ret == 0
670
671 @pytest.mark.parametrize("strict", [True, False])
672 def test_xfail_condition_keyword(self, pytester: Pytester, strict: bool) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected