本文介绍了设置pycharm运行django unittest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我无法运行Django Python pytest在PyCharm下
从上述网址得到答案后.我现在正在尝试尽我所能充分利用我的IDE功能.
这是我公司中另一个使用Django UnitTest的项目.这是我使用的命令行.

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

实际上,不需要--settings=eneos.config.settings.local,因为我已经将该配置放入了wsgi.py中.但是当我问这个问题时,显性胜于隐性.

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.

很不幸.它不像pytest那样简单.我必须在这里错过一些要点.

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

窗口的前几行.

/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.

完成!

推荐答案

有一个 Django tests运行配置.

There is a Django tests run configuration.

使用它,您可以设置特定于Django的选项;例如Custom settings.

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

这篇关于设置pycharm运行django unittest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:27