From 6d764b35f77c08e7a7beff888b722b0dd33e7833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 15 Aug 2024 17:59:11 +0200 Subject: [PATCH] test_history_cli: clear capsys before reading from program --- pkgs/clan-cli/tests/test_history_cli.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/clan-cli/tests/test_history_cli.py b/pkgs/clan-cli/tests/test_history_cli.py index e65c7b2af..fd664b091 100644 --- a/pkgs/clan-cli/tests/test_history_cli.py +++ b/pkgs/clan-cli/tests/test_history_cli.py @@ -35,14 +35,12 @@ def test_history_list( capsys: CaptureFixture, test_flake_with_core: FlakeForTest, ) -> None: - cmd = [ - "history", - "list", - ] - - cli.run(cmd) + capsys.readouterr() + cli.run(["history", "list"]) assert str(test_flake_with_core.path) not in capsys.readouterr().out cli.run(["history", "add", f"clan://{test_flake_with_core.path}#vm1"]) - cli.run(cmd) + + capsys.readouterr() + cli.run(["history", "list"]) assert str(test_flake_with_core.path) in capsys.readouterr().out