如何在django中使用--patterns进行测试(how to use --patterns for tests in django)
我有一个带有测试的测试文件,不会用常规调用
manage.py test
命令,只有当我特意告诉django这样做时。
所以我的文件与tests.py位于同一个文件夹中,其名称为test_blub.py
我尝试过
manage.py test --pattern="test_*.py"
任何想法?
I have a test file with tests in it which will not be called with the regular
manage.py test
command, only when I specifically tell django to do so.
So my file lives in the same folder as tests.py and its name is test_blub.py
I tried it with
manage.py test --pattern="test_*.py"
Any idea?
最满意答案
好的,所以关键很简单,文件不应该以测试开始。
我把它命名为blub_test.py ,然后调用它
./manage.py test --pattern="blub_test.py"
Ok, so the key is quite simple, the file is not supposed to start with test.
I named it blub_test.py and then called it with
./manage.py test --pattern="blub_test.py"
更多推荐
发布评论