From 0a05f7efd7d7ea40e6aac110e787ed095017f4de Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 26 Aug 2024 14:43:42 -0700 Subject: [PATCH] fix: Ensure tool_error is called at least once in tests --- tests/basic/test_models.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/basic/test_models.py b/tests/basic/test_models.py index 040647eaa..2ba0a77ae 100644 --- a/tests/basic/test_models.py +++ b/tests/basic/test_models.py @@ -40,10 +40,9 @@ class TestModels(unittest.TestCase): sanity_check_model(mock_io, model) - mock_io.tool_error.assert_called_once_with( - "Model test-model: Environment variables status:" - ) + mock_io.tool_error.assert_called() calls = mock_io.tool_error.call_args_list + self.assertIn("Model test-model: Environment variables status:", str(calls)) self.assertIn("- API_KEY1: ✓ Set", str(calls)) self.assertIn("- API_KEY2: ✓ Set", str(calls)) @@ -59,10 +58,9 @@ class TestModels(unittest.TestCase): sanity_check_model(mock_io, model) - mock_io.tool_error.assert_called_once_with( - "Model test-model: Environment variables status:" - ) + mock_io.tool_error.assert_called() calls = mock_io.tool_error.call_args_list + self.assertIn("Model test-model: Environment variables status:", str(calls)) self.assertIn("- API_KEY1: ✗ Not set", str(calls)) self.assertIn("- API_KEY2: ✗ Not set", str(calls))