From 0a61e83c2b0177161eac49a050d542f1ad85578b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 29 Jul 2024 16:46:56 -0300 Subject: [PATCH] Fix the `test_cmd_lint_with_dirty_file` test to handle the `MagicMock` object returned by the `lint` method. --- tests/basic/test_commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/basic/test_commands.py b/tests/basic/test_commands.py index 2ca71af31..948db1517 100644 --- a/tests/basic/test_commands.py +++ b/tests/basic/test_commands.py @@ -721,12 +721,18 @@ class TestCommands(TestCase): # Mock the linter.lint method with mock.patch.object(coder.linter, "lint") as mock_lint: + # Set up the mock to return an empty string (no lint errors) + mock_lint.return_value = "" + # Run cmd_lint commands.cmd_lint() # Check if the linter was called with the dirty file mock_lint.assert_called_once_with(filename) + # Verify that the file is still dirty after linting + self.assertTrue(repo.is_dirty(filename)) + del coder del commands del repo