【发布时间】:2013-06-26 13:09:18
【问题描述】:
运行时:
./manage.py test appname
如何在“OK”后禁用所有统计/日志记录/输出?
- 我已经注释掉了整个日志记录部分 - 运气不好。
- 还注释掉了任何 print_stat 调用 - 运气不好
- 我的 manage.py 非常简单,所以可能不是这样。
我运行了许多测试,并且经常需要向上滚动数千条终端行才能查看结果。 显然,我是 Python/Django 的新手,它是一个测试框架,所以我将不胜感激。
----------------------------------------------------------------------
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}
如果有帮助,我正在导入:
from django.utils import unittest
class TestEmployeeAdd(unittest.TestCase):
def setUp(self):
【问题讨论】:
-
我看不出你要删除什么。
-
一切都低于“OK”。基本上我不想看到任何统计数据。我只想看看测试是通过还是失败。
-
您使用的是 Linux/Unix 还是类似的 shell?
-
Mac 终端使用 virtualenv 实现基于 Python 的环境
-
我在 GNU/Linux 上没有发生这种情况,我看不出你从哪里获得分析信息。确保您没有在某处导入 python 分析器?