def test_run_stderr(): """ Run a process and capture stdout """ pytest.dbgfunc() r = tbx.run("ls --nosuch") assert "ERR:" in r assert re.findall("(illegal|unrecognized) option", r)
def test_run_fail(): """ Run a binary that doesn't exist """ pytest.dbgfunc() r = tbx.run("nosuchbinary") assert "ERR:" in r assert "No such file or directory" in r
def test_run_stdout(): """ Run a process and capture stdout """ pytest.dbgfunc() r = tbx.run('python -c "import this"') assert "Zen of Python" in r assert "Namespaces" in r