How do I see stdout when running Django tests? How do I see stdout when running Django tests? django django

How do I see stdout when running Django tests?


Checked TEST_RUNNER in settings.py, it's using a project-specific runner that calls out to Nose. Nose has the -s option to stop it from capturing stdout, but if I run:

./manage.py test -s

manage.py captures it first and throws a "no such option" error. The help for manage.py doesn't mention this, but I found that if I run:

./manage.py test -- -s

it ignores the -s and lets me capture it on the custom runner's side, passing it to Nose without a problem.


Yeah, this issue is caused by NoseTestSuiteRunner. Adding -- -s is tricky and not the best solution.Try to add the following lines in the settings.py:

NOSE_ARGS = ['--nocapture',             '--nologcapture',]

This solved my problems.


There are several levels of verbosity available which affects the amount of details we see:You can try:

python manage.py test -v 2

Other levels available are:

  • -v 0 : Least amount of details

  • -v 1: Default

  • -v 2 : More details e.g. print statements included.