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

Method test_parse_set_options

testing/test_parseopt.py:168–176  ·  view source on GitHub ↗
(self, parser: parseopt.Parser)

Source from the content-addressed store, hash-verified

166 assert option.hello == "x"
167
168 def test_parse_set_options(self, parser: parseopt.Parser) -> None:
169 parser.addoption("--hello", dest="hello", action="store")
170 parser.addoption("--world", dest="world", default=42)
171
172 option = argparse.Namespace()
173 parser.parse(["--hello", "world"], option)
174 assert option.hello == "world"
175 assert option.world == 42
176 assert getattr(option, parseopt.FILE_OR_DIR) == []
177
178 def test_parse_special_destination(self, parser: parseopt.Parser) -> None:
179 parser.addoption("--ultimate-answer", type=int)

Callers

nothing calls this directly

Calls 2

addoptionMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected