Fix cmd to default print on all outputs. Default print on stderr

This commit is contained in:
Qubasa
2024-01-10 17:31:11 +01:00
parent 715ed10e59
commit 2f9195b779
2 changed files with 2 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ def handle_output(process: subprocess.Popen, log: Log) -> tuple[str, str]:
return stdout_buf.decode("utf-8"), stderr_buf.decode("utf-8") return stdout_buf.decode("utf-8"), stderr_buf.decode("utf-8")
def run(cmd: list[str], cwd: Path = Path.cwd(), log: Log = Log.BOTH) -> CmdOut: def run(cmd: list[str], cwd: Path = Path.cwd(), log: Log = Log.STDERR) -> CmdOut:
# Start the subprocess # Start the subprocess
process = subprocess.Popen( process = subprocess.Popen(
cmd, cwd=str(cwd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True cmd, cwd=str(cwd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True

View File

@@ -14,6 +14,7 @@ def test_machine_subcommands(
capsys.readouterr() capsys.readouterr()
cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"]) cli.run(["--flake", str(test_flake_with_core.path), "machines", "list"])
out = capsys.readouterr() out = capsys.readouterr()
assert "machine1\nvm1\nvm2\n" == out.out assert "machine1\nvm1\nvm2\n" == out.out