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

Method test_parse_known_args

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

Source from the content-addressed store, hash-verified

127 assert getattr(args, parseopt.FILE_OR_DIR)[0] == "."
128
129 def test_parse_known_args(self, parser: parseopt.Parser) -> None:
130 parser.parse_known_args([Path(".")])
131 parser.addoption("--hello", action="store_true")
132 ns = parser.parse_known_args(["x", "--y", "--hello", "this"])
133 assert ns.hello
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")

Callers

nothing calls this directly

Calls 2

parse_known_argsMethod · 0.80
addoptionMethod · 0.45

Tested by

no test coverage detected