def popen_output(self, args, cwd=None, report=True): if isinstance(args, str): args = std.shlex.split(args) assert args[0], args args = [str(x) for x in args] if cwd == None: cwd = self.cwd if report: self.report_popen(args, cwd) return check_output(args, cwd=str(cwd))
def popen_output(self, args, cwd=None, report=True): if isinstance(args, str): args = std.shlex.split(args) assert args[0], args args = [str(x) for x in args] if cwd == None: cwd = self.cwd cmd = py.path.local.sysfind(args[0]) if not cmd: self.fatal("command not found: %s" % args[0]) args[0] = str(cmd) if report: self.report_popen(args, cwd) return check_output(args, cwd=str(cwd))
def test_checkoutput_error(hg): with pytest.raises(CalledProcessError): check_output([hg, "qlwkje"])
def test_check_output(hg): assert check_output([hg, "--version"])
def check_output(self, args): args = self._getargs(args) self.tw.line("$ %s [captured]" % " ".join(args)) return check_output(args)