Perform an in-process test run. :param args: List of command line arguments. If `None` or not given, defaults to reading arguments directly from the process command line (:data:`sys.argv`). :param plugins: List of plugin objects to be auto-registered during initialization.
(
args: list[str] | os.PathLike[str] | None = None,
plugins: Sequence[str | _PluggyPlugin] | None = None,
)
| 186 | |
| 187 | |
| 188 | def main( |
| 189 | args: list[str] | os.PathLike[str] | None = None, |
| 190 | plugins: Sequence[str | _PluggyPlugin] | None = None, |
| 191 | ) -> int | ExitCode: |
| 192 | """Perform an in-process test run. |
| 193 | |
| 194 | :param args: |
| 195 | List of command line arguments. If `None` or not given, defaults to reading |
| 196 | arguments directly from the process command line (:data:`sys.argv`). |
| 197 | :param plugins: List of plugin objects to be auto-registered during initialization. |
| 198 | |
| 199 | :returns: An exit code. |
| 200 | """ |
| 201 | return _main(args=args, plugins=plugins, prog="pytest.main()") |
| 202 | |
| 203 | |
| 204 | def _main( |