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

前端 未结 20 2658
孤独总比滥情好
孤独总比滥情好 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:28

    I started getting weird ConftestImportFailure: ImportError('No module named ... errors when I had accidentally added __init__.py file to my src directory (which was not supposed to be a Python package, just a container of all source).

提交回复
热议问题