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

Function test_record_testsuite_property

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

Source from the content-addressed store, hash-verified

1525
1526@parametrize_families
1527def test_record_testsuite_property(
1528 pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
1529) -> None:
1530 pytester.makepyfile(
1531 """
1532 def test_func1(record_testsuite_property):
1533 record_testsuite_property("stats", "all good")
1534
1535 def test_func2(record_testsuite_property):
1536 record_testsuite_property("stats", 10)
1537 """
1538 )
1539 result, dom = run_and_parse(family=xunit_family)
1540 assert result.ret == 0
1541 node = dom.find_first_by_tag("testsuite")
1542 properties_node = node.find_first_by_tag("properties")
1543 p1_node = properties_node.find_nth_by_tag("property", 0)
1544 p2_node = properties_node.find_nth_by_tag("property", 1)
1545 p1_node.assert_attr(name="stats", value="all good")
1546 p2_node.assert_attr(name="stats", value="10")
1547
1548
1549def test_record_testsuite_property_junit_disabled(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected