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

Method test_skip_contains_name_reason

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

Source from the content-addressed store, hash-verified

363
364 @parametrize_families
365 def test_skip_contains_name_reason(
366 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
367 ) -> None:
368 pytester.makepyfile(
369 """
370 import pytest
371 def test_skip():
372 pytest.skip("hello23")
373 """
374 )
375 result, dom = run_and_parse(family=xunit_family)
376 assert result.ret == 0
377 node = dom.find_first_by_tag("testsuite")
378 node.assert_attr(skipped=1)
379 tnode = node.find_first_by_tag("testcase")
380 tnode.assert_attr(classname="test_skip_contains_name_reason", name="test_skip")
381 snode = tnode.find_first_by_tag("skipped")
382 snode.assert_attr(type="pytest.skip", message="hello23")
383
384 @parametrize_families
385 def test_mark_skip_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