I used easy_install to install pytest on a mac and started writing tests for a project with a file structure likes so:
repo/ repo/app.py repo/settings.py rep
We have fixed the issue by adding the following environment variable.
PYTHONPATH=${PYTHONPATH}:${PWD}/src:${PWD}/test