Python Django manage.py测试
运行时:Python Django manage.py测试,python,django,testing,Python,Django,Testing,运行时: /manage.py测试appname 如何在“确定”后禁用所有统计/日志记录/输出 我已经注释掉了整个日志部分-不走运 还注释掉了任何打印统计调用-不走运 我的manage.py非常简单,所以可能不是这样 我运行了许多测试,并不断地向上滚动数千条终端线以查看结果。 显然,我是Python/Django及其测试框架的新手,因此我非常感谢您的帮助 ---------------------------------------------------------------------
/manage.py测试appname
如何在“确定”后禁用所有统计/日志记录/输出
- 我已经注释掉了整个日志部分-不走运
- 还注释掉了任何打印统计调用-不走运
- 我的manage.py非常简单,所以可能不是这样
----------------------------------------------------------------------
Ran 2 tests in 2.133s
OK
1933736 function calls (1929454 primitive calls) in 2.133 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 2.133 2.133 <string>:1(<module>)
30 0.000 0.000 0.000 0.000 <string>:8(__new__)
4 0.000 0.000 0.000 0.000 Cookie.py:315(_quote)
26 0.000 0.000 0.000 0.000 Cookie.py:333(_unquote)
10 0.000 0.000 0.000 0.000 Cookie.py:432(__init__)
28 0.000 0.000 0.000 0.000 Cookie.py:441(__setitem__)
.
.
.
2 0.000 0.000 0.000 0.000 {time.gmtime}
18 0.000 0.000 0.000 0.000 {time.localtime}
18 0.000 0.000 0.000 0.000 {time.strftime}
295 0.000 0.000 0.000 0.000 {time.time}
556 0.000 0.000 0.000 0.000 {zip}
如果您使用类似于shell(Mac)的
unix
,您可以使用它来执行以下操作:
python manage.py test appname | head -n 3
python manage.py test appname -v 0
将数字3
切换到OK
行后需要截断输出的数字
此外,您还可以通过将命令的详细程度设置为最小值(如下所示)来测试是否更喜欢输出:
python manage.py test appname | head -n 3
python manage.py test appname -v 0
希望这有帮助 我看不出你想要删除的是什么。下面的所有内容都是“OK”。基本上我不想看到任何统计数据。我只想看看测试是通过了还是失败了。你是在Linux/Unix或类似的shell上吗?Mac终端在基于Python的环境中使用virtualenv。我没有在GNU/Linux上发生这种情况,我不知道你从哪里得到这些分析信息。确保您没有在某处导入python分析器?我很高兴!不客气:如果有用的话,请考虑接受答案: