From 3998bf4c2e9dc3a26085b852ba77bf2933723d1e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 19 May 2023 09:07:56 -0700 Subject: [PATCH] aider: Fixed InputOutput instantiation 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: original_cwd = os.getcwd() os.chdir(tmpdir) > io = InputOutput() E TypeError: InputOutput.__init__() missing 2 required positional arguments: 'pretty' and 'yes' /Users/gauthier/Projects/aider/tests/test_commands.py:14: TypeError =========================== short test summary info ============================ FAILED tests/test_commands.py::TestCommands::test_cmd_add - TypeError: InputO... ============================== 1 failed in 0.77s =============================== ASSISTANT: I apologize for the oversight. The `InputOutput` class requires two positional arguments: `pretty` and `yes`. Let's update the test to provide these arguments. Here's the code change: ```python tests/test_commands.py <<<<<<< ORIGINAL io = InputOutput() ======= io = InputOutput(pretty=True, yes=True) >>>>>>> UPDATED ``` This should fix the `TypeError` and allow the test to run successfully. --- 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 cf4a5700e..be4918ae1 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -11,7 +11,7 @@ class TestCommands(TestCase): original_cwd = os.getcwd() os.chdir(tmpdir) - io = InputOutput() + io = InputOutput(pretty=True, yes=True) coder = Coder(io) commands = Commands(io, coder)