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

后端 未结 4 1861
后悔当初
后悔当初 2020-12-12 15:13

When I type

$ nosetests -v mytest.py

all my print outputs are captured when all tests pass. I want to see print outputs even everything pas

相关标签:
4条回答
  • 2020-12-12 15:45

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

    nosetests -s
    
    0 讨论(0)
  • 2020-12-12 15:49

    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)

    0 讨论(0)
  • 2020-12-12 15:50

    Use

    --nologcapture 
    

    it worked for me

    0 讨论(0)
  • 2020-12-12 16:00

    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',
    )
    
    0 讨论(0)
提交回复
热议问题