When I run tests with ./manage.py test
, whatever I send to the standard output through print
doesn't show. When tests fail, I see an "stdout" block per failed test, so I guess Django traps it (but doesn't show it when tests pass).

- 8,987
- 11
- 54
- 85
-
1You should mark you own answer as correct since it is. – Catskul Aug 19 '14 at 15:41
-
my Django ver 1.11 printss everything, without any `-s` or `--no-input` – Arthur Sult May 10 '18 at 09:39
5 Answers
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.

- 8,987
- 11
- 54
- 85
-
2Because I am using the contrib.sites framework, I specify --settings for my tests. When I do that, -s flag functions as expected, and passing in another -- before the -s throws an OSError (No such file -s). – ken Dec 19 '11 at 18:21
-
2Just for the record. If you have django_south installed in INSTALLED_APPS __after__ django_nose it won't let you give options for nose (like -s). You need to put south __before__ django_nose in INSTALLED_APPS. It was the issue with me – yakxxx Oct 04 '12 at 21:29
-
Oddly this seems to work for me with `print(...)`, but the output of pretty print with `pprint.pprint(...)` does not show in the console. – Taylor D. Edmiston May 12 '16 at 00:21
-
For me adding -s worked pretty fine, as I am advised not to play with the settings.py file. – Rishik Mani Aug 15 '19 at 13:38
-
-
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.

- 1,952
- 2
- 17
- 28

- 1,369
- 10
- 8
-
5This is the correct answer. The `-- -s` method causes undesired side effects. – adam Sep 23 '14 at 17:47
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.

- 4,555
- 31
- 31
- 45

- 551
- 1
- 5
- 9
Using current versions of all the relevant packages (Django==1.11.2
, django-nose==1.4.5
and nose==1.3.7
) it is sufficient to add the --nocapture
flag when running your tests. Thus a simple
./manage.py test --nocapture
will suffice.
Granted of course that you have
TEST_RUNNER = "django_nose.NoseTestSuiteRunner"
in your settings.py

- 3,026
- 1
- 34
- 41
You probably have some intermediate test runner, such as Nose, intercepting and storing stdout. Try either running the Django tests directly, or write to stderr instead.

- 197,344
- 39
- 212
- 226
-
1You were right. Running the django tests directly doesn't work because there's a lot of settings things up that the custom runner does, but I was able to trace the problem and fix it. Now this is my first question here, so is it ok to edit the question to include the solution like above? Thanks! – agentofuser Aug 06 '09 at 00:29
-
1
-
This is not always the case, I have encountered situations where you get this behaviour without nose. I don't have a solution but i think this answer is incomplete. – Techdragon Aug 04 '13 at 10:54