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

Method test_parse_known_and_unknown_args

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

Source from the content-addressed store, hash-verified

134 assert ns.file_or_dir == ["x"]
135
136 def test_parse_known_and_unknown_args(self, parser: parseopt.Parser) -> None:
137 parser.addoption("--hello", action="store_true")
138 ns, unknown = parser.parse_known_and_unknown_args(
139 ["x", "--y", "--hello", "this"]
140 )
141 assert ns.hello
142 assert ns.file_or_dir == ["x"]
143 assert unknown == ["--y", "this"]
144
145 def test_parse_will_set_default(self, parser: parseopt.Parser) -> None:
146 parser.addoption("--hello", dest="hello", default="x", action="store")

Callers

nothing calls this directly

Calls 2

addoptionMethod · 0.45

Tested by

no test coverage detected