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

Method test_junit_prefixing

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

Source from the content-addressed store, hash-verified

614
615 @parametrize_families
616 def test_junit_prefixing(
617 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
618 ) -> None:
619 pytester.makepyfile(
620 """
621 def test_func():
622 assert 0
623 class TestHello(object):
624 def test_hello(self):
625 pass
626 """
627 )
628 result, dom = run_and_parse("--junitprefix=xyz", family=xunit_family)
629 assert result.ret
630 node = dom.find_first_by_tag("testsuite")
631 node.assert_attr(failures=1, tests=2)
632 tnode = node.find_first_by_tag("testcase")
633 tnode.assert_attr(classname="xyz.test_junit_prefixing", name="test_func")
634 tnode = node.find_nth_by_tag("testcase", 1)
635 tnode.assert_attr(
636 classname="xyz.test_junit_prefixing.TestHello", name="test_hello"
637 )
638
639 @parametrize_families
640 def test_xfailure_function(

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected