Commit graph

3 commits

Author SHA1 Message Date
Paul Gauthier
0860e7b30d do not package tests/ 2024-07-15 08:40:32 +01:00
Paul Gauthier
ce46ea8d62 moved tests/ to aider/tests/ 2024-06-10 15:33:49 -07:00
Paul Gauthier
fe4a2836b7 aider: Added empty __init__.py file to tests directory to fix ModuleNotFoundError when running tests.
# Context:
USER: when I run pytests i get this error

======================================== ERRORS =========================================
_________________________ ERROR collecting tests/test_utils.py __________________________
ImportError while importing test module '/Users/gauthier/Projects/aider/tests/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_utils.py:2: in <module>
    from aider.utils import replace_most_similar_chunk, strip_quoted_wrapping
E   ModuleNotFoundError: No module named 'aider'

ASSISTANT: It seems like the `aider` module is not being recognized when running the tests. To fix this issue, you can add an empty `__init__.py` file in the `tests` directory to make it a package. This will help Python recognize the `aider` module when running the tests.

Create a new empty file `tests/__init__.py`:

```python
tests/__init__.py
<<<<<<< ORIGINAL
=======
>>>>>>> UPDATED
```

After creating the empty `__init__.py` file in the `tests` directory, try running the tests again.
2023-05-11 17:12:42 -07:00