MCPcopy
hub / github.com/pytest-dev/pytest / test_collect_error

Method test_collect_error

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

Source from the content-addressed store, hash-verified

817
818 @parametrize_families
819 def test_collect_error(
820 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
821 ) -> None:
822 pytester.makepyfile("syntax error")
823 result, dom = run_and_parse(family=xunit_family)
824 assert result.ret
825 node = dom.get_first_by_tag("testsuite")
826 node.assert_attr(errors=1, tests=1)
827 tnode = node.get_first_by_tag("testcase")
828 fnode = tnode.get_first_by_tag("error")
829 fnode.assert_attr(message="collection failure")
830 assert "SyntaxError" in fnode.toxml()
831
832 def test_unicode(self, pytester: Pytester, run_and_parse: RunAndParse) -> None:
833 value = "hx\xc4\x85\xc4\x87\n"

Callers

nothing calls this directly

Calls 5

run_and_parseFunction · 0.85
get_first_by_tagMethod · 0.80
assert_attrMethod · 0.80
toxmlMethod · 0.80
makepyfileMethod · 0.45

Tested by

no test coverage detected