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

Function run

tests/_util.py:56–72  ·  view source on GitHub ↗

Run ``invocation`` via ``program``, returning output stream captures. ``program`` defaults to ``Program()``. To skip automatically assuming the argv under test starts with ``"invoke "``, say ``invoke=False``. :returns: Two-tuple of ``stdout, stderr`` strings.

(invocation, program=None, invoke=True)

Source from the content-addressed store, hash-verified

54
55@trap
56def run(invocation, program=None, invoke=True):
57 """
58 Run ``invocation`` via ``program``, returning output stream captures.
59
60 ``program`` defaults to ``Program()``.
61
62 To skip automatically assuming the argv under test starts with ``"invoke
63 "``, say ``invoke=False``.
64
65 :returns: Two-tuple of ``stdout, stderr`` strings.
66 """
67 if program is None:
68 program = Program()
69 if invoke:
70 invocation = "invoke {}".format(invocation)
71 program.run(invocation, exit=False)
72 return sys.stdout.getvalue(), sys.stderr.getvalue()
73
74
75def expect(

Calls 2

runMethod · 0.95
ProgramClass · 0.90

Tested by

no test coverage detected