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

Method test_summing_simple_with_errors

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

Source from the content-addressed store, hash-verified

233
234 @parametrize_families
235 def test_summing_simple_with_errors(
236 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
237 ) -> None:
238 pytester.makepyfile(
239 """
240 import pytest
241 @pytest.fixture
242 def fixture():
243 raise Exception()
244 def test_pass():
245 pass
246 def test_fail():
247 assert 0
248 def test_error(fixture):
249 pass
250 @pytest.mark.xfail
251 def test_xfail():
252 assert False
253 @pytest.mark.xfail(strict=True)
254 def test_xpass():
255 assert True
256 """
257 )
258 result, dom = run_and_parse(family=xunit_family)
259 assert result.ret
260 node = dom.get_first_by_tag("testsuite")
261 node.assert_attr(name="pytest", errors=1, failures=2, skipped=1, tests=5)
262
263 @parametrize_families
264 def test_hostname_in_xml(

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected