From 9d749240677a951d688d0f3e237c2a058193b108 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 18 May 2023 17:27:19 -0700 Subject: [PATCH] aider: Fixed IO class initialization in test_cmd_add. # Context: USER: I ran this command: pytest tests/test_commands.py Which produced this output: ============================= test session starts ============================== platform darwin -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0 rootdir: /Users/gauthier/Projects/aider collected 1 item tests/test_commands.py F [100%] =================================== FAILURES =================================== __________________________ TestCommands.test_cmd_add ___________________________ self = def test_cmd_add(self): with tempfile.TemporaryDirectory() as tmpdir: > io = IO() E TypeError: InputOutput.__init__() missing 4 required positional arguments: 'pretty', 'yes', 'input_history_file', and 'chat_history_file' tests/test_commands.py:12: TypeError =========================== short test summary info ============================ FAILED tests/test_commands.py::TestCommands::test_cmd_add - TypeError: InputO... ============================== 1 failed in 0.47s =============================== ASSISTANT: I apologize for the oversight. The `InputOutput` class requires four arguments during initialization. Let's update the test to provide the required arguments. ```python tests/test_commands.py <<<<<<< ORIGINAL io = IO() ======= io = IO(pretty=False, yes=True, input_history_file=None, chat_history_file=None) >>>>>>> UPDATED ``` This change should fix the `TypeError` when initializing the `IO` class in the test. --- tests/test_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 935c3ba98..8eb6dcd61 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -9,7 +9,7 @@ from aider.coder import Coder class TestCommands(unittest.TestCase): def test_cmd_add(self): with tempfile.TemporaryDirectory() as tmpdir: - io = IO() + io = IO(pretty=False, yes=True, input_history_file=None, chat_history_file=None) coder = Coder(root=tmpdir) commands = Commands(io, coder)