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

Method test_xfailure_marker

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

Source from the content-addressed store, hash-verified

658
659 @parametrize_families
660 def test_xfailure_marker(
661 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
662 ) -> None:
663 pytester.makepyfile(
664 """
665 import pytest
666 @pytest.mark.xfail(reason="42")
667 def test_xfail():
668 assert False
669 """
670 )
671 result, dom = run_and_parse(family=xunit_family)
672 assert not result.ret
673 node = dom.find_first_by_tag("testsuite")
674 node.assert_attr(skipped=1, tests=1)
675 tnode = node.find_first_by_tag("testcase")
676 tnode.assert_attr(classname="test_xfailure_marker", name="test_xfail")
677 fnode = tnode.find_first_by_tag("skipped")
678 fnode.assert_attr(type="pytest.xfail", message="42")
679
680 @pytest.mark.parametrize(
681 "junit_logging", ["no", "log", "system-out", "system-err", "out-err", "all"]

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