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

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

    I was getting this error due to something even simpler (you could even say trivial). I hadn't installed the pytest module. So a simple apt install python-pytest fixed it for me.

    'pytest' would have been listed in setup.py as a test dependency. Make sure you install the test requirements as well.

提交回复
热议问题