示例#1
0
文件: run.py 项目: markatto/invoke
 def hide_err_only_hides_stderr(self):
     run("echo 'foo' && echo 'bar' 1>&2", hide='err')
     eq_(sys.stdout.getvalue().strip(), "foo")
     eq_(sys.stderr.getvalue().strip(), "")
示例#2
0
文件: run.py 项目: markatto/invoke
 def hide_None_hides_nothing(self):
     run("echo 'foo' && echo 'bar' 1>&2", hide=None)
     eq_(sys.stdout.getvalue().strip(), "foo")
     eq_(sys.stderr.getvalue().strip(), "bar")
示例#3
0
文件: run.py 项目: markatto/invoke
 def hide_kwarg_allows_hiding_output(self):
     run("echo 'foo'", hide='both')
     eq_(sys.stdall.getvalue(), "")
示例#4
0
文件: run.py 项目: markatto/invoke
 def hide_out_only_hides_stdout(self):
     run("echo 'foo' && echo 'bar' 1>&2", hide='out')
     eq_(sys.stdout.getvalue().strip(), "")
     eq_(sys.stderr.getvalue().strip(), "bar")
示例#5
0
文件: run.py 项目: markatto/invoke
 def non_one_return_codes_still_act_as_False(self):
     ok_(not run("goobypls", warn=True, hide='both'))
示例#6
0
文件: run.py 项目: markatto/invoke
 def warn_kwarg_allows_continuing_past_failures(self):
     eq_(run("false", warn=True).exited, 1)
示例#7
0
文件: run.py 项目: markatto/invoke
 def fast_failures(self):
     run("false")
示例#8
0
文件: cli.py 项目: markatto/invoke
 def implicit_task_module(self):
     # Contains tasks.py
     os.chdir('implicit')
     # Doesn't specify --collection
     result = run("invoke foo")
     eq_(result.stdout, "Hm\n")
示例#9
0
文件: run.py 项目: markatto/invoke
 def return_code_in_result(self):
     r = run("echo 'foo'", hide='both')
     eq_(r.stdout, "foo\n")
     eq_(r.return_code, 0)
     eq_(r.exited, 0)
示例#10
0
文件: run.py 项目: markatto/invoke
 def nonzero_return_code_for_failures(self):
     result = run("false", warn=True)
     eq_(result.exited, 1)
     result = run("goobypls", warn=True, hide='both')
     eq_(result.exited, 127)
示例#11
0
文件: fail.py 项目: markatto/invoke
def fail():
    run("false")
示例#12
0
文件: cli.py 项目: markatto/invoke
 def command_failure(self):
     "Command failure doesn't show tracebacks"
     result = run("inv -c fail fail", warn=True)
     sentinel = 'Traceback (most recent call last)'
     assert sentinel not in result.stderr
     assert result.exited != 0
示例#13
0
文件: cli.py 项目: markatto/invoke
 def invocation_with_args(self):
     result = run("invoke -c integration print_name --name whatevs")
     eq_(result.stdout, "whatevs\n")
示例#14
0
文件: run.py 项目: markatto/invoke
 def hide_unknown_vals_raises_ValueError(self):
     run("command", hide="what")
示例#15
0
文件: run.py 项目: markatto/invoke
 def run_acts_as_success_boolean(self):
     ok_(not run("false", warn=True))
     ok_(run("true"))
示例#16
0
文件: tasks.py 项目: markatto/invoke
def test(module=None):
    run("spec" + ((" --tests=tests/%s.py" % module) if module else ""))
示例#17
0
文件: cli.py 项目: markatto/invoke
 def setup(self):
     os.chdir(support)
     sys.stdout, self.orig_stdout = StringIO.StringIO(), sys.stdout
     sys.stderr, self.orig_stderr = StringIO.StringIO(), sys.stderr
     self.result = run("invoke -c integration print_foo")