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

Method test_xfailure_function

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

Source from the content-addressed store, hash-verified

638
639 @parametrize_families
640 def test_xfailure_function(
641 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
642 ) -> None:
643 pytester.makepyfile(
644 """
645 import pytest
646 def test_xfail():
647 pytest.xfail("42")
648 """
649 )
650 result, dom = run_and_parse(family=xunit_family)
651 assert not result.ret
652 node = dom.find_first_by_tag("testsuite")
653 node.assert_attr(skipped=1, tests=1)
654 tnode = node.find_first_by_tag("testcase")
655 tnode.assert_attr(classname="test_xfailure_function", name="test_xfail")
656 fnode = tnode.find_first_by_tag("skipped")
657 fnode.assert_attr(type="pytest.xfail", message="42")
658
659 @parametrize_families
660 def test_xfailure_marker(

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