test_history_cli: clear capsys before reading from program

This commit is contained in:
Jörg Thalheim
2024-08-15 17:59:11 +02:00
parent 65d44c644a
commit aec45d3a1a

View File

@@ -35,14 +35,12 @@ def test_history_list(
capsys: CaptureFixture, capsys: CaptureFixture,
test_flake_with_core: FlakeForTest, test_flake_with_core: FlakeForTest,
) -> None: ) -> None:
cmd = [ capsys.readouterr()
"history", cli.run(["history", "list"])
"list",
]
cli.run(cmd)
assert str(test_flake_with_core.path) not in capsys.readouterr().out 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(["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 assert str(test_flake_with_core.path) in capsys.readouterr().out