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

Method inline_runsource

src/_pytest/pytester.py:1029–1041  ·  view source on GitHub ↗

Run a test module in process using ``pytest.main()``. This run writes "source" into a temporary file and runs ``pytest.main()`` on it, returning a :py:class:`HookRecorder` instance for the result. :param source: The source code of the test module. :param cmd

(self, source: str, *cmdlineargs)

Source from the content-addressed store, hash-verified

1027 return runner(item)
1028
1029 def inline_runsource(self, source: str, *cmdlineargs) -> HookRecorder:
1030 """Run a test module in process using ``pytest.main()``.
1031
1032 This run writes "source" into a temporary file and runs
1033 ``pytest.main()`` on it, returning a :py:class:`HookRecorder` instance
1034 for the result.
1035
1036 :param source: The source code of the test module.
1037 :param cmdlineargs: Any extra command line arguments to use.
1038 """
1039 p = self.makepyfile(source)
1040 values = list(cmdlineargs) + [p]
1041 return self.inline_run(*values)
1042
1043 def inline_genitems(self, *args) -> Tuple[List[Item], HookRecorder]:
1044 """Run ``pytest.main(['--collectonly'])`` in-process.

Calls 2

makepyfileMethod · 0.95
inline_runMethod · 0.95

Tested by

no test coverage detected