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

Method setup_method

tests/parser_context.py:160–173  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158
159 class help_for:
160 def setup_method(self):
161 # Normal, non-task/collection related Context
162 self.vanilla = Context(
163 args=(Argument("foo"), Argument("bar", help="bar the baz"))
164 )
165
166 # Task/Collection generated Context
167 # (will expose flags n such)
168 @task(help={"otherarg": "other help"}, optional=["optval"])
169 def mytask(c, myarg, otherarg, optval, intval=5):
170 pass
171
172 col = Collection(mytask)
173 self.tasked = col.to_contexts()[0]
174
175 def raises_ValueError_for_non_flag_values(self):
176 with raises(ValueError):

Callers

nothing calls this directly

Calls 4

to_contextsMethod · 0.95
ArgumentClass · 0.90
CollectionClass · 0.90
ContextClass · 0.85

Tested by

no test coverage detected