mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
![]() # Context: USER: I ran this command: pytest tests/test_main.py And got 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 4 items tests/test_main.py F... [100%] =================================== FAILURES =================================== ______________________ TestMain.test_main_no_auto_commits ______________________ self = <tests.test_main.TestMain testMethod=test_main_no_auto_commits> def test_main_no_auto_commits(self): > with unittest.mock.patch("aider.main.Coder") as MockCoder: E NameError: name 'unittest' is not defined tests/test_main.py:37: NameError =========================== short test summary info ============================ FAILED tests/test_main.py::TestMain::test_main_no_auto_commits - NameError: n... ========================= 1 failed, 3 passed in 1.29s ========================== ASSISTANT: It looks like the `unittest` module is not imported in the `tests/test_main.py` file. To fix this issue, you need to add the import statement for the `unittest` module at the beginning of the file. Here's the change: ```python tests/test_main.py <<<<<<< ORIGINAL import os import tempfile from unittest import TestCase from aider.main import main ======= import os import tempfile import unittest from unittest import TestCase from aider.main import main >>>>>>> UPDATED ``` This will import the `unittest` module and resolve the `NameError`. |
||
---|---|---|
.. | ||
__init__.py | ||
test_commands.py | ||
test_main.py | ||
test_repomap.py | ||
test_utils.py |