You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is problematic if you are using a tool like tox to test your package in a virtual environment, because you want to test the installed version of your package, not the local code from the repository.
In this situation, it is strongly suggested to use a src layout where application root package resides in a sub-directory of your root:
This layout prevents a lot of common pitfalls and has many benefits, which are better explained in this excellent blog post by Ionel Cristian Mărieș.
To run pytest with this layout, we need override PYTHONPATH to ./src, so need to run pytest like PYTHONPATH=src pytest. Don't we need to provide a way to override PYTHONPATH? I'll dig on it.
The text was updated successfully, but these errors were encountered:
In pytest documentation, they also recommend to use
src
directory layout.To run pytest with this layout, we need override
PYTHONPATH
to./src
, so need to run pytest likePYTHONPATH=src pytest
. Don't we need to provide a way to overridePYTHONPATH
? I'll dig on it.The text was updated successfully, but these errors were encountered: