wolt-python-package-cookiecutter
wolt-python-package-cookiecutter copied to clipboard
No __init__.py in tests
The tests directory isn't a Python package and shouldn't be imported. Don't have any __init__.py files there.
Not sure about this one 🤔 This is from the pytest docs:

So, I think it should be fine as we are using the src layout 🙂
we are using the src layout
that means you’re using a src directory wherein your package resides, it has nothing to do with the __init__.py.
To learn about that, plase read these excerpts from the document I linked:
If you need to have test modules with the same name, you might add
__init__.pyfiles to yourtestfolder and subfolders, changing them to packages:
Note the If above, and the Note below:
The
--import-mode=importliboption (see Import modes) does not have any of the drawbacks above because sys.path is not changed when importing test modules, so users that run into this issue are strongly encouraged to try it.
Regarding the pytest docs, I’ll try to make that more accessible: https://github.com/pytest-dev/pytest/pull/10206