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

Method test_parse_setoption

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

Source from the content-addressed store, hash-verified

151 assert option.hello == "x"
152
153 def test_parse_setoption(self, parser: parseopt.Parser) -> None:
154 parser.addoption("--hello", dest="hello", action="store")
155 parser.addoption("--world", dest="world", default=42)
156
157 option = argparse.Namespace()
158 args = parser.parse_setoption(["--hello", "world"], option)
159 assert option.hello == "world"
160 assert option.world == 42
161 assert not args
162
163 def test_parse_special_destination(self, parser: parseopt.Parser) -> None:
164 parser.addoption("--ultimate-answer", type=int)

Callers

nothing calls this directly

Calls 2

parse_setoptionMethod · 0.80
addoptionMethod · 0.45

Tested by

no test coverage detected