When running:
./manage.py test appname
How can I disable all the stats/logging/output after "OK"?
I run many tests and constantly have to scroll up thousands of terminal lines to view results. Clearly, I am new to Python/Django and it's testing framework, so I would appreciate any help.
----------------------------------------------------------------------
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}
If it helps, I am importing:
from django.utils import unittest
class TestEmployeeAdd(unittest.TestCase):
def setUp(self):
If you use a unix-like shell (Mac does) you can use the head command to do the trick like this:
python manage.py test appname | head -n 3
Switch the number 3 for the one you need to truncate the output after the OK line.
Also you can test if you like more the output yielded by setting the verbosity of the command to minimal like this:
python manage.py test appname -v 0
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With