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

Method test_xfailure_xpass_strict

testing/test_junitxml.py:731–749  ·  view source on GitHub ↗
(
        self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
    )

Source from the content-addressed store, hash-verified

729
730 @parametrize_families
731 def test_xfailure_xpass_strict(
732 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
733 ) -> None:
734 pytester.makepyfile(
735 """
736 import pytest
737 @pytest.mark.xfail(strict=True, reason="This needs to fail!")
738 def test_xpass():
739 pass
740 """
741 )
742 result, dom = run_and_parse(family=xunit_family)
743 # assert result.ret
744 node = dom.find_first_by_tag("testsuite")
745 node.assert_attr(skipped=0, tests=1)
746 tnode = node.find_first_by_tag("testcase")
747 tnode.assert_attr(classname="test_xfailure_xpass_strict", name="test_xpass")
748 fnode = tnode.find_first_by_tag("failure")
749 fnode.assert_attr(message="[XPASS(strict)] This needs to fail!")
750
751 @parametrize_families
752 def test_collect_error(

Callers

nothing calls this directly

Calls 4

run_and_parseFunction · 0.85
find_first_by_tagMethod · 0.80
assert_attrMethod · 0.80
makepyfileMethod · 0.45

Tested by

no test coverage detected