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

Method runpytest

src/_pytest/pytester.py:1211–1219  ·  view source on GitHub ↗

Run pytest inline or in a subprocess, depending on the command line option "--runpytest" and return a :py:class:`~pytest.RunResult`.

(self, *args: str | os.PathLike[str], **kwargs: Any)

Source from the content-addressed store, hash-verified

1209 return res
1210
1211 def runpytest(self, *args: str | os.PathLike[str], **kwargs: Any) -> RunResult:
1212 """Run pytest inline or in a subprocess, depending on the command line
1213 option "--runpytest" and return a :py:class:`~pytest.RunResult`."""
1214 new_args = self._ensure_basetemp(args)
1215 if self._method == "inprocess":
1216 return self.runpytest_inprocess(*new_args, **kwargs)
1217 elif self._method == "subprocess":
1218 return self.runpytest_subprocess(*new_args, **kwargs)
1219 raise RuntimeError(f"Unrecognized runpytest option: {self._method}")
1220
1221 def _ensure_basetemp(
1222 self, args: Sequence[str | os.PathLike[str]]

Calls 3

_ensure_basetempMethod · 0.95
runpytest_inprocessMethod · 0.95
runpytest_subprocessMethod · 0.95

Tested by

no test coverage detected