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

Method test_summing_simple_with_errors

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

Source from the content-addressed store, hash-verified

168
169 @parametrize_families
170 def test_summing_simple_with_errors(
171 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
172 ) -> None:
173 pytester.makepyfile(
174 """
175 import pytest
176 @pytest.fixture
177 def fixture():
178 raise Exception()
179 def test_pass():
180 pass
181 def test_fail():
182 assert 0
183 def test_error(fixture):
184 pass
185 @pytest.mark.xfail
186 def test_xfail():
187 assert False
188 @pytest.mark.xfail(strict=True)
189 def test_xpass():
190 assert True
191 """
192 )
193 result, dom = run_and_parse(family=xunit_family)
194 assert result.ret
195 node = dom.find_first_by_tag("testsuite")
196 node.assert_attr(name="pytest", errors=1, failures=2, skipped=1, tests=5)
197
198 @parametrize_families
199 def test_hostname_in_xml(

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected