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

Function test_url_property

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

Source from the content-addressed store, hash-verified

1498
1499
1500def test_url_property(pytester: Pytester) -> None:
1501 test_url = "http://www.github.com/pytest-dev"
1502 path = pytester.path.joinpath("test_url_property.xml")
1503 log = LogXML(str(path), None)
1504
1505 class Report(BaseReport):
1506 longrepr = "FooBarBaz"
1507 sections: List[Tuple[str, str]] = []
1508 nodeid = "something"
1509 location = "tests/filename.py", 42, "TestClass.method"
1510 url = test_url
1511
1512 test_report = cast(TestReport, Report())
1513
1514 log.pytest_sessionstart()
1515 node_reporter = log._opentestcase(test_report)
1516 node_reporter.append_failure(test_report)
1517 log.pytest_sessionfinish()
1518
1519 test_case = minidom.parse(str(path)).getElementsByTagName("testcase")[0]
1520
1521 assert (
1522 test_case.getAttribute("url") == test_url
1523 ), "The URL did not get written to the xml"
1524
1525
1526@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