2.9.0: pytest fails because missing tests/__init__.py
Closed this issue · 2 comments
kloczek commented
Looks like empty tests/init.py file is missing
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp_retry-2.9.0
configfile: pyproject.toml
plugins: asyncio-0.23.8, aiohttp-1.0.5
asyncio: mode=auto
collected 5 items / 1 error
==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_client.py _____________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/aiohttp_retry-2.9.0/tests/test_client.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_client.py:20: in <module>
from tests.app import App
E ModuleNotFoundError: No module named 'tests'
=========================== short test summary info ============================
ERROR tests/test_client.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.18s ===============================
After create that file
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp_retry-2.9.0
configfile: pyproject.toml
plugins: asyncio-0.23.8, aiohttp-1.0.5
asyncio: mode=auto
collected 42 items
tests/test_client.py ..................................... [ 88%]
tests/test_retry_options.py ..... [100%]
============================= 42 passed in 16.80s ==============================
kloczek commented
Thank you 👍