On my machine, I can't run the unit tests.
When I do poetry run pytest, or when the tests are ran through the push hook, it raises
_______________________________________ ERROR collecting tests/networking/test_validator.py ________________________________________
ImportError while importing test module 'C:\Users\Public\codg\forks\tiny-web-crawler\tests\networking\test_validator.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\Tiago Charrão\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests\networking\test_validator.py:1: in <module>
from tiny_web_crawler.networking.validator import is_valid_url
E ModuleNotFoundError: No module named 'tiny_web_crawler'
For every test file.
Steps to reproduce
Create a virtual environment with py -m venv .
Install the dependencies with poetry install --with dev
Install the pre-commit hooks with pre-commit installpre-commit install --hook-type pre-push
Run poetry run pytest
Additional info
The tests still run fine on the ci.
I was able to run them by replacing
from tiny_web_crawler.etc...
with
from src.tiny_web_crawler.etc...
On my machine, I can't run the unit tests. When I do
poetry run pytest
, or when the tests are ran through the push hook, it raisesFor every test file.
Steps to reproduce
py -m venv .
poetry install --with dev
pre-commit install
pre-commit install --hook-type pre-push
poetry run pytest
Additional info The tests still run fine on the ci. I was able to run them by replacing
from tiny_web_crawler.etc...
withfrom src.tiny_web_crawler.etc...