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 c41bc10325
commit 626e5558f3
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")
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
process = subprocess.Popen(
cmd, cwd=str(cwd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True

View File

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