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

Method test_collect_error

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

Source from the content-addressed store, hash-verified

750
751 @parametrize_families
752 def test_collect_error(
753 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
754 ) -> None:
755 pytester.makepyfile("syntax error")
756 result, dom = run_and_parse(family=xunit_family)
757 assert result.ret
758 node = dom.find_first_by_tag("testsuite")
759 node.assert_attr(errors=1, tests=1)
760 tnode = node.find_first_by_tag("testcase")
761 fnode = tnode.find_first_by_tag("error")
762 fnode.assert_attr(message="collection failure")
763 assert "SyntaxError" in fnode.toxml()
764
765 def test_unicode(self, pytester: Pytester, run_and_parse: RunAndParse) -> None:
766 value = "hx\xc4\x85\xc4\x87\n"

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected