Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.9.0: pytest fails because missing tests/__init__.py #105

Closed
kloczek opened this issue Oct 27, 2024 · 2 comments
Closed

2.9.0: pytest fails because missing tests/__init__.py #105

kloczek opened this issue Oct 27, 2024 · 2 comments

Comments

@kloczek
Copy link

kloczek commented Oct 27, 2024

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 ==============================
@inyutin
Copy link
Owner

inyutin commented Oct 27, 2024

File is added
#106

@inyutin inyutin closed this as completed Oct 27, 2024
@kloczek
Copy link
Author

kloczek commented Oct 27, 2024

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants