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

When I type

$ nosetests -v

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:

It feels so hackish, there must be a better way. Enlighten me please.



$ nosetests --nocapture


$ NOSE_NOCAPTURE=1 nosetests

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



it worked for me

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

nosetests -s

In order to integrate with I have put this into .travis.yml:

script:  "python nosetests -s"

where contains:


Need Your Help

Can I connect directly to a Redis server from JavaScript running in a browser?

javascript api rest redis

I know there are node.js libraries for Redis; what I'd like to do is run a Redis server (either on localhost or on a server host somewhere) and call it directly via HTTP (i.e. AJAX or HTTP GET as n...