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

Method parseconfig

src/_pytest/pytester.py:1192–1213  ·  view source on GitHub ↗

Return a new pytest Config instance from given commandline args. This invokes the pytest bootstrapping code in _pytest.config to create a new :py:class:`_pytest.core.PluginManager` and call the pytest_cmdline_parse hook to create a new :py:class:`pytest.Config` insta

(self, *args: Union[str, "os.PathLike[str]"])

Source from the content-addressed store, hash-verified

1190 return new_args
1191
1192 def parseconfig(self, *args: Union[str, "os.PathLike[str]"]) -> Config:
1193 """Return a new pytest Config instance from given commandline args.
1194
1195 This invokes the pytest bootstrapping code in _pytest.config to create
1196 a new :py:class:`_pytest.core.PluginManager` and call the
1197 pytest_cmdline_parse hook to create a new
1198 :py:class:`pytest.Config` instance.
1199
1200 If :py:attr:`plugins` has been populated they should be plugin modules
1201 to be registered with the PluginManager.
1202 """
1203 import _pytest.config
1204
1205 new_args = self._ensure_basetemp(args)
1206 new_args = [str(x) for x in new_args]
1207
1208 config = _pytest.config._prepareconfig(new_args, self.plugins) # type: ignore[arg-type]
1209 # we don't know what the test will do with this half-setup config
1210 # object and thus we make sure it gets unconfigured properly in any
1211 # case (otherwise capturing could still be active, for example)
1212 self._request.addfinalizer(config._ensure_unconfigure)
1213 return config
1214
1215 def parseconfigure(self, *args: Union[str, "os.PathLike[str]"]) -> Config:
1216 """Return a new pytest configured Config instance.

Callers 15

parseconfigureMethod · 0.95
test_rewriteMethod · 0.45
test_gitignoreFunction · 0.45
test_preserve_keys_orderFunction · 0.45
test_cachedir_tagFunction · 0.45
test_parseconfigFunction · 0.45
test_ini_namesMethod · 0.45
test_pyproject_tomlMethod · 0.45

Calls 2

_ensure_basetempMethod · 0.95
addfinalizerMethod · 0.45

Tested by

no test coverage detected