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

Function test_record_attribute

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

Source from the content-addressed store, hash-verified

1267
1268@pytest.mark.filterwarnings("default")
1269def test_record_attribute(pytester: Pytester, run_and_parse: RunAndParse) -> None:
1270 pytester.makeini(
1271 """
1272 [pytest]
1273 junit_family = xunit1
1274 """
1275 )
1276 pytester.makepyfile(
1277 """
1278 import pytest
1279
1280 @pytest.fixture
1281 def other(record_xml_attribute):
1282 record_xml_attribute("bar", 1)
1283 def test_record(record_xml_attribute, other):
1284 record_xml_attribute("foo", "<1");
1285 """
1286 )
1287 result, dom = run_and_parse()
1288 node = dom.find_first_by_tag("testsuite")
1289 tnode = node.find_first_by_tag("testcase")
1290 tnode.assert_attr(bar="1")
1291 tnode.assert_attr(foo="<1")
1292 result.stdout.fnmatch_lines(
1293 ["*test_record_attribute.py:6:*record_xml_attribute is an experimental feature"]
1294 )
1295
1296
1297@pytest.mark.filterwarnings("default")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected