From fe4a2836b764b2bdff5f7edf71223ca783a8d328 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 11 May 2023 17:12:42 -0700 Subject: [PATCH] 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 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. --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..e69de29bb