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

Method test_mark_skip_contains_name_reason

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

Source from the content-addressed store, hash-verified

383
384 @parametrize_families
385 def test_mark_skip_contains_name_reason(
386 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
387 ) -> None:
388 pytester.makepyfile(
389 """
390 import pytest
391 @pytest.mark.skip(reason="hello24")
392 def test_skip():
393 assert True
394 """
395 )
396 result, dom = run_and_parse(family=xunit_family)
397 assert result.ret == 0
398 node = dom.find_first_by_tag("testsuite")
399 node.assert_attr(skipped=1)
400 tnode = node.find_first_by_tag("testcase")
401 tnode.assert_attr(
402 classname="test_mark_skip_contains_name_reason", name="test_skip"
403 )
404 snode = tnode.find_first_by_tag("skipped")
405 snode.assert_attr(type="pytest.skip", message="hello24")
406
407 @parametrize_families
408 def test_mark_skipif_contains_name_reason(

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