MCPcopy Index your code
hub / github.com/pyinvoke/invoke / clones_initial_context

Method clones_initial_context

tests/parser_parser.py:142–155  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

140 assert r.remainder == "bar biz"
141
142 def clones_initial_context(self) -> None:
143 a = Argument("foo", kind=bool)
144 assert a.value is None
145 c = Context(args=(a,))
146 p = Parser(initial=c)
147 assert p.initial is c
148 r = p.parse_argv(["--foo"])
149 assert p.initial is c
150 c2 = r[0]
151 assert c2 is not c
152 a2 = c2.args["foo"]
153 assert a2 is not a
154 assert a.value is None
155 assert a2.value is True
156
157 def clones_noninitial_contexts(self) -> None:
158 a = Argument("foo")

Callers

nothing calls this directly

Calls 4

parse_argvMethod · 0.95
ArgumentClass · 0.90
ParserClass · 0.90
ContextClass · 0.85

Tested by

no test coverage detected