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
You can run with PYTHONPATH in project root
PYTHONPATH=. py.test
Or use pip install as editable import
pip install -e . # install package using setup.py in editable mode