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

Method addoption

src/_pytest/config/argparsing.py:105–119  ·  view source on GitHub ↗

Register a command line option. :param opts: Option names, can be short or long options. :param attrs: Same attributes as the argparse library's :meth:`add_argument() <argparse.ArgumentParser.add_argument>` function accepts. After command

(self, *opts: str, **attrs: Any)

Source from the content-addressed store, hash-verified

103 return group
104
105 def addoption(self, *opts: str, **attrs: Any) -> None:
106 """Register a command line option.
107
108 :param opts:
109 Option names, can be short or long options.
110 :param attrs:
111 Same attributes as the argparse library&#x27;s :meth:`add_argument()
112 <argparse.ArgumentParser.add_argument>` function accepts.
113
114 After command line parsing, options are available on the pytest config
115 object via ``config.option.NAME`` where ``NAME`` is usually set
116 by passing a ``dest`` attribute, for example
117 ``addoption("--long", dest="NAME", ...)``.
118 """
119 self._anonymous.addoption(*opts, **attrs)
120
121 def parse(
122 self,

Callers 15

pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
add_option_iniFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45
pytest_addoptionFunction · 0.45

Calls

no outgoing calls