如何在django中使用

编程入门 行业动态 更新时间:2024-10-22 22:59:49
如何在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"

更多推荐

本文发布于:2023-08-06 04:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444563.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   django

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!