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

Class RunAndParse

testing/test_junitxml.py:35–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35class RunAndParse:
36 def __init__(self, pytester: Pytester, schema: xmlschema.XMLSchema) -> None:
37 self.pytester = pytester
38 self.schema = schema
39
40 def __call__(
41 self, *args: Union[str, "os.PathLike[str]"], family: Optional[str] = "xunit1"
42 ) -> Tuple[RunResult, "DomNode"]:
43 if family:
44 args = ("-o", "junit_family=" + family) + args
45 xml_path = self.pytester.path.joinpath("junit.xml")
46 result = self.pytester.runpytest("--junitxml=%s" % xml_path, *args)
47 if family == "xunit2":
48 with xml_path.open() as f:
49 self.schema.validate(f)
50 xmldoc = minidom.parse(str(xml_path))
51 return result, DomNode(xmldoc)
52
53
54@pytest.fixture

Callers 1

run_and_parseFunction · 0.85

Calls

no outgoing calls

Tested by 1

run_and_parseFunction · 0.68