Setting pycharm run django unittest

不问归期 提交于 2019-12-10 23:31:20

问题


I can not run Django Python pytest under PyCharm
After I got the answer from the above URL. I am now trying to fully utilize my IDE functions as much as I can.
Here is another project in my company that using Django UnitTest. This is the command line I used.

$ python manage.py test --settings=eneos.config.settings.local

Actually --settings=eneos.config.settings.local is not required, because I put that config in the wsgi.py already. But explicit is better than implicit when I ask the question.

Unfortunately. It is not simple like pytest. I must miss some points in here.

First several lines in the window.

/Users/el/.pyenv/versions/eneos-pos-web/bin/python "/Users/el/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/171.4694.38/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py" --path .
Testing started at 2:17 PM ...
Launching unittests with arguments python -m unittest discover -s . -t /Users/el/Code/eneos-pos-web in /Users/el/Code/eneos-pos-web
Error
Traceback (most recent call last):

Update: It used to ask me with Exclamation mark and let me fix the path in the bottom right. Just put working directory and configuration file in the asking form.

Done!


回答1:


There is a Django tests run configuration.

Using that, you can set Django-specific options; Custom settings, for example.



来源:https://stackoverflow.com/questions/44868381/setting-pycharm-run-django-unittest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!