MCPcopy
hub / github.com/tox-dev/tox / test_parser_const_with_default_none

Function test_parser_const_with_default_none

tests/config/cli/test_parser.py:17–31  ·  view source on GitHub ↗
(monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

15
16
17def test_parser_const_with_default_none(monkeypatch: MonkeyPatch) -> None:
18 monkeypatch.setenv("TOX_ALPHA", "2")
19 parser = ToxParser.base()
20 parser.add_argument(
21 "-a",
22 dest="alpha",
23 action="store_const",
24 const=1,
25 default=None,
26 help="sum the integers (default: find the max)",
27 )
28 parser.fix_defaults()
29
30 result = parser.parse_args([])
31 assert result.alpha == 2
32
33
34@pytest.mark.parametrize("is_atty", [True, False])

Callers

nothing calls this directly

Calls 4

baseMethod · 0.80
add_argumentMethod · 0.80
fix_defaultsMethod · 0.80
parse_argsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…