How can I see normal print output created during pytest run?

Des picture Des · Jan 18, 2013 · Viewed 161.1k times · Source

Sometimes I want to just insert some print statements in my code, and see what gets printed out when I exercise it. My usual way to "exercise" it is with existing pytest tests. But when I run these, I don't seem able to see any standard output (at least from within PyCharm, my IDE).

Is there a simple way to see standard output during a pytest run?

Answer

hpk42 picture hpk42 · Jan 19, 2013

The -s switch disables per-test capturing (only if a test fails).