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

Method test_internal_error

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

Source from the content-addressed store, hash-verified

480
481 @parametrize_families
482 def test_internal_error(
483 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
484 ) -> None:
485 pytester.makeconftest("def pytest_runtest_protocol(): 0 / 0")
486 pytester.makepyfile("def test_function(): pass")
487 result, dom = run_and_parse(family=xunit_family)
488 assert result.ret
489 node = dom.find_first_by_tag("testsuite")
490 node.assert_attr(errors=1, tests=1)
491 tnode = node.find_first_by_tag("testcase")
492 tnode.assert_attr(classname="pytest", name="internal")
493 fnode = tnode.find_first_by_tag("error")
494 fnode.assert_attr(message="internal error")
495 assert "Division" in fnode.toxml()
496
497 @pytest.mark.parametrize(
498 "junit_logging", ["no", "log", "system-out", "system-err", "out-err", "all"]

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected