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 passes.
So what I'm doing is to force an assertion error to see the output, like this.
class MyTest(TestCase):
    def setUp(self):
        self.debug = False
    def test_0(self):
        a = .... # construct an instance of something
        # ... some tests statements
        print a.dump()
        if self.debug:
            eq_(0,1)
It feels so hackish, there must be a better开发者_开发百科 way. Enlighten me please.
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)
Use
--nologcapture 
it worked for me
This was added recently to nose instead of --nocapture do this:
nosetests -s
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',
)
Try this,
nosetests -v 2 -s yourtest
Flags expect order.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论