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

Method test_multiple_metavar_help

testing/test_parseopt.py:276–288  ·  view source on GitHub ↗

Help text for options with a metavar tuple should display help in the form "--preferences=value1 value2 value3" (#2004).

(self, parser: parseopt.Parser)

Source from the content-addressed store, hash-verified

274 assert "-doit, --func-args foo" in help
275
276 def test_multiple_metavar_help(self, parser: parseopt.Parser) -> None:
277 """
278 Help text for options with a metavar tuple should display help
279 in the form "--preferences=value1 value2 value3" (#2004).
280 """
281 group = parser.getgroup("general")
282 group.addoption(
283 "--preferences", metavar=("value1", "value2", "value3"), nargs=3
284 )
285 group._addoption("-h", "--help", action="store_true", dest="help")
286 parser.parse(["-h"])
287 help = parser.optparser.format_help()
288 assert "--preferences=value1 value2 value3" in help
289
290
291def test_argcomplete(pytester: Pytester, monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 4

getgroupMethod · 0.80
_addoptionMethod · 0.80
addoptionMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected