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

Method __init__

src/_pytest/pytester.py:522–547  ·  view source on GitHub ↗
(
        self,
        ret: int | ExitCode,
        outlines: list[str],
        errlines: list[str],
        duration: float,
    )

Source from the content-addressed store, hash-verified

520 """The result of running a command from :class:`~pytest.Pytester`."""
521
522 def __init__(
523 self,
524 ret: int | ExitCode,
525 outlines: list[str],
526 errlines: list[str],
527 duration: float,
528 ) -> None:
529 try:
530 self.ret: int | ExitCode = ExitCode(ret)
531 """The return value."""
532 except ValueError:
533 self.ret = ret
534 self.outlines = outlines
535 """List of lines captured from stdout."""
536 self.errlines = errlines
537 """List of lines captured from stderr."""
538 self.stdout = LineMatcher(outlines)
539 """:class:`~pytest.LineMatcher` of stdout.
540
541 Use e.g. :func:`str(stdout) <pytest.LineMatcher.__str__()>` to reconstruct stdout, or the commonly used
542 :func:`stdout.fnmatch_lines() <pytest.LineMatcher.fnmatch_lines()>` method.
543 """
544 self.stderr = LineMatcher(errlines)
545 """:class:`~pytest.LineMatcher` of stderr."""
546 self.duration = duration
547 """Duration in seconds."""
548
549 def __repr__(self) -> str:
550 return (

Callers

nothing calls this directly

Calls 2

ExitCodeClass · 0.90
LineMatcherClass · 0.85

Tested by

no test coverage detected