From 0758c4d401814e3a0aa951a6760a665aaf00905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Tue, 20 Aug 2024 20:38:05 +0200 Subject: [PATCH] fix: improved test flakiness --- tests/test_cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 8f15d409..76933cdd 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -290,8 +290,13 @@ def test_subagent(args: list[str], runner: CliRunner): # apparently this is not obviously 610 accepteds = ["377", "610"] - assert any(accepted in result.output for accepted in accepteds) - assert any(accepted in result.output.split("```")[-1] for accepted in accepteds) + assert any([accepted in result.output for accepted in accepteds]) + assert any( + [ + accepted in "```".join(result.output.split("```")[-2:]) + for accepted in accepteds + ] + ) @pytest.mark.slow