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

Method __init__

src/_pytest/config/__init__.py:1104–1160  ·  view source on GitHub ↗
(
        self,
        pluginmanager: PytestPluginManager,
        *,
        invocation_params: InvocationParams | None = None,
        prog: str | None = None,
    )

Source from the content-addressed store, hash-verified

1102 cache: Cache
1103
1104 def __init__(
1105 self,
1106 pluginmanager: PytestPluginManager,
1107 *,
1108 invocation_params: InvocationParams | None = None,
1109 prog: str | None = None,
1110 ) -> None:
1111 if invocation_params is None:
1112 invocation_params = self.InvocationParams(
1113 args=(), plugins=None, dir=pathlib.Path.cwd()
1114 )
1115
1116 self.option = argparse.Namespace()
1117 """Access to command line option as attributes.
1118
1119 :type: argparse.Namespace
1120 """
1121
1122 self.invocation_params = invocation_params
1123 """The parameters with which pytest was invoked.
1124
1125 :type: InvocationParams
1126 """
1127
1128 self._parser = Parser(
1129 usage=f"%(prog)s [options] [{FILE_OR_DIR}] [{FILE_OR_DIR}] [...]",
1130 processopt=self._processopt,
1131 prog=prog,
1132 _ispytest=True,
1133 )
1134 self.pluginmanager = pluginmanager
1135 """The plugin manager handles plugin registration and hook invocation.
1136
1137 :type: PytestPluginManager
1138 """
1139
1140 self.stash = Stash()
1141 """A place where plugins can store information on the config for their
1142 own use.
1143
1144 :type: Stash
1145 """
1146 # Deprecated alias. Was never public. Can be removed in a few releases.
1147 self._store = self.stash
1148
1149 self.trace = self.pluginmanager.trace.root.get("config")
1150 self.hook = self.pluginmanager.hook
1151 self._inicache: dict[str, Any] = {}
1152 self._inicfg: ConfigDict = {}
1153 self._cleanup_stack = contextlib.ExitStack()
1154 self.pluginmanager.register(self, "pytestconfig")
1155 self._configured = False
1156 self.hook.pytest_addoption.call_historic(
1157 kwargs=dict(parser=self._parser, pluginmanager=self.pluginmanager)
1158 )
1159 self.args_source = Config.ArgsSource.ARGS
1160 self.args: list[str] = []
1161

Callers 1

__init__Method · 0.45

Calls 4

ParserClass · 0.90
StashClass · 0.90
registerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected