跑步时:
./manage.py test appname
如何禁用"OK“之后的所有stats/日志记录/输出?
我运行了许多测试,并不断地滚动数千个终端线来查看结果。显然,我对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):发布于 2013-06-26 13:38:32
如果您使用unix-like shell (Mac ),您可以使用 command来执行如下操作:
python manage.py test appname | head -n 3切换数字3,以便在OK行之后截断输出。
此外,还可以通过将命令的verbosity设置为最小值来测试是否需要更多的输出,如下所示:
python manage.py test appname -v 0希望这能有所帮助!
https://stackoverflow.com/questions/17320943
复制相似问题