MCPcopy
hub / github.com/pytest-dev/pytest / test_url_property

Function test_url_property

testing/test_junitxml.py:1592–1615  ·  testing/test_junitxml.py::test_url_property
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1590
1591
1592def test_url_property(pytester: Pytester) -> None:
1593 test_url = class="st">"http://www.github.com/pytest-dev"
1594 path = pytester.path.joinpath(class="st">"test_url_property.xml")
1595 log = LogXML(str(path), None)
1596
1597 class Report(BaseReport):
1598 longrepr = class="st">"FooBarBaz"
1599 sections: list[tuple[str, str]] = []
1600 nodeid = class="st">"something"
1601 location = class="st">"tests/filename.py", 42, class="st">"TestClass.method"
1602 url = test_url
1603
1604 test_report = cast(TestReport, Report())
1605
1606 log.pytest_sessionstart()
1607 node_reporter = log._opentestcase(test_report)
1608 node_reporter.append_failure(test_report)
1609 log.pytest_sessionfinish()
1610
1611 test_case = minidom.parse(str(path)).getElementsByTagName(class="st">"testcase")[0]
1612
1613 assert test_case.getAttribute(class="st">"url") == test_url, (
1614 class="st">"The URL did not get written to the xml"
1615 )
1616
1617
1618@parametrize_families

Callers

nothing calls this directly

Calls 7

pytest_sessionstartMethod · 0.95
_opentestcaseMethod · 0.95
pytest_sessionfinishMethod · 0.95
LogXMLClass · 0.90
ReportClass · 0.85
append_failureMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected