def test_with_path_result_code(tmpdir): """ result code should be non-zero on error """ params = ['-c', "raise ValueError()"] res = launch.with_path(str(tmpdir), params) assert res > 0
def test_with_path(tmpdir, capfd): params = ['-c', 'import sys; print(sys.path)'] res = launch.with_path(str(tmpdir), params) assert res == 0 out, err = capfd.readouterr() assert str(tmpdir) in out
def test_with_path(tmpdir, capfd): params = ['-c', 'import sys; sys.stdout.write("\\n".join(sys.path))'] res = launch.with_path(str(tmpdir), params) assert res == 0 out, err = capfd.readouterr() assert tmpdir in out.split(os.linesep)