我有一个Django项目,其中有一堆我刚刚导入到PyCharm中的测试。我设法对它进行了配置,这样我就可以运行服务器了,这很好,但是现在我也想运行测试。我尝试创建一个基于路径的测试配置,并给出管理.py路径和test命令以及我的设置文件作为参数,但我收到以下神秘的错误消息:
Testing started at 10:12 ...
/Users/jonathan/anaconda/bin/python "/Applications/PyCharm CE.app/Contents/helpers/pycharm/_jb_unittest_runner.py" --path /Users/jonathan/Work/GenettaSoft/modeling-web/modeling/manage.py -- test --settings=Modeling.settings.tests
Launching unittests with arguments python -m unittest /Users/jonathan/Work/GenettaSoft/modeling-web/modeling/manage.py test --settings=Modeling.settings.tests in /Users/jonathan/Work/GenettaSoft/modeling-web/modeling
usage: python -m unittest [-h] [-v] [-q] [--locals] [-f] [-c]
[tests [tests ...]]
python -m unittest: error: unrecognized arguments: --settings=Modeling.settings.tests
Process finished with exit code 2
Empty test suite.
它一定在某种程度上把事情搞砸了。难道这一点也做不到吗?在
我找到了Running Django tests in PyCharm,但它似乎一点都不相关(老得多的版本?),因为我得到不同的错误和事情看起来非常不同。在