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 = <tests.test_commands.TestCommands testMethod=test_cmd_add>

    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.
This commit is contained in:
Paul Gauthier 2023-05-19 09:07:56 -07:00
parent 922d28216a
commit 3998bf4c2e

View file

@ -11,7 +11,7 @@ class TestCommands(TestCase):
original_cwd = os.getcwd() original_cwd = os.getcwd()
os.chdir(tmpdir) os.chdir(tmpdir)
io = InputOutput() io = InputOutput(pretty=True, yes=True)
coder = Coder(io) coder = Coder(io)
commands = Commands(io, coder) commands = Commands(io, coder)