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

Method test_mark_skip_contains_name_reason

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

Source from the content-addressed store, hash-verified

452
453 @parametrize_families
454 def test_mark_skip_contains_name_reason(
455 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
456 ) -> None:
457 pytester.makepyfile(
458 """
459 import pytest
460 @pytest.mark.skip(reason="hello24")
461 def test_skip():
462 assert True
463 """
464 )
465 result, dom = run_and_parse(family=xunit_family)
466 assert result.ret == 0
467 node = dom.get_first_by_tag("testsuite")
468 node.assert_attr(skipped=1)
469 tnode = node.get_first_by_tag("testcase")
470 tnode.assert_attr(
471 classname="test_mark_skip_contains_name_reason", name="test_skip"
472 )
473 snode = tnode.get_first_by_tag("skipped")
474 snode.assert_attr(type="pytest.skip", message="hello24")
475
476 @parametrize_families
477 def test_mark_skipif_contains_name_reason(

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