PATH issue with pytest 'ImportError: No module named YadaYadaYada'

前端 未结 20 2394
孤独总比滥情好
孤独总比滥情好 2020-11-22 07:10

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         


        
20条回答
  •  情话喂你
    2020-11-22 07:45

    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
    

提交回复
热议问题