Example #1
0
 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(), "")
Example #2
0
 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")
Example #3
0
 def hide_kwarg_allows_hiding_output(self):
     run("echo 'foo'", hide='both')
     eq_(sys.stdall.getvalue(), "")
Example #4
0
 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")
Example #5
0
 def non_one_return_codes_still_act_as_False(self):
     ok_(not run("goobypls", warn=True, hide='both'))
Example #6
0
 def warn_kwarg_allows_continuing_past_failures(self):
     eq_(run("false", warn=True).exited, 1)
Example #7
0
 def fast_failures(self):
     run("false")
Example #8
0
 def implicit_task_module(self):
     # Contains tasks.py
     os.chdir('implicit')
     # Doesn't specify --collection
     result = run("invoke foo")
     eq_(result.stdout, "Hm\n")
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
def fail():
    run("false")
Example #12
0
 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
Example #13
0
 def invocation_with_args(self):
     result = run("invoke -c integration print_name --name whatevs")
     eq_(result.stdout, "whatevs\n")
Example #14
0
 def hide_unknown_vals_raises_ValueError(self):
     run("command", hide="what")
Example #15
0
 def run_acts_as_success_boolean(self):
     ok_(not run("false", warn=True))
     ok_(run("true"))
Example #16
0
def test(module=None):
    run("spec" + ((" --tests=tests/%s.py" % module) if module else ""))
Example #17
0
 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")