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

Function test_record_property

testing/test_junitxml.py:1211–1230  ·  view source on GitHub ↗
(pytester: Pytester, run_and_parse: RunAndParse)

Source from the content-addressed store, hash-verified

1209
1210
1211def test_record_property(pytester: Pytester, run_and_parse: RunAndParse) -> None:
1212 pytester.makepyfile(
1213 """
1214 import pytest
1215
1216 @pytest.fixture
1217 def other(record_property):
1218 record_property("bar", 1)
1219 def test_record(record_property, other):
1220 record_property("foo", "<1");
1221 """
1222 )
1223 result, dom = run_and_parse()
1224 node = dom.find_first_by_tag("testsuite")
1225 tnode = node.find_first_by_tag("testcase")
1226 psnode = tnode.find_first_by_tag("properties")
1227 pnodes = psnode.find_by_tag("property")
1228 pnodes[0].assert_attr(name="bar", value="1")
1229 pnodes[1].assert_attr(name="foo", value="<1")
1230 result.stdout.fnmatch_lines(["*= 1 passed in *"])
1231
1232
1233def test_record_property_same_name(

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected