The Python Oracle

nosetests is capturing the output of my print statements. How to circumvent this?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping

--

Chapters
00:00 Nosetests Is Capturing The Output Of My Print Statements. How To Circumvent This?
00:37 Accepted Answer Score 229
00:56 Answer 2 Score 17
01:07 Answer 3 Score 10
01:20 Answer 4 Score 3
01:41 Answer 5 Score 1
01:51 Thank you

--

Full question
https://stackoverflow.com/questions/5975...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #nosetests

#avk47



ACCEPTED ANSWER

Score 229


Either:

$ nosetests --nocapture mytest.py

Or:

$ NOSE_NOCAPTURE=1 nosetests mytests.py

(it can also be specified in the nose.cfg file, see nosetests --help)




ANSWER 2

Score 17


Use

--nologcapture 

it worked for me




ANSWER 3

Score 10


This was added recently to nose instead of --nocapture do this:

nosetests -s



ANSWER 4

Score 3


In order to integrate with http://travis-ci.org I have put this into .travis.yml:

script:  "python setup.py nosetests -s"

where setup.py contains:

setup(
    ...
    tests_require=['nose>=1.0'],
    test_suite='nose.collector',
)