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

Function test_url_property

testing/test_junitxml.py:1592–1615  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1590
1591
1592def test_url_property(pytester: Pytester) -> None:
1593 test_url = "http://www.github.com/pytest-dev"
1594 path = pytester.path.joinpath("test_url_property.xml")
1595 log = LogXML(str(path), None)
1596
1597 class Report(BaseReport):
1598 longrepr = "FooBarBaz"
1599 sections: list[tuple[str, str]] = []
1600 nodeid = "something"
1601 location = "tests/filename.py", 42, "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("testcase")[0]
1612
1613 assert test_case.getAttribute("url") == test_url, (
1614 "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…