Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python unittest.TestCase for testing the output of standard stream(stdout, stderr)

Project description


Build Status Coverage Status


The streamtest provides the enhanced unittest.TestCase for testing the output of standard stream (stdout, stderr).


from stramtest import CatchStreamTestCase

class StreamTestCase(CatchStreamTestCase):

    def test_stdout(self):

        with self.catch_stream("stdout") as stream:
            print "hello world"

        self.assertEqual(stream, "hello world\n")

    def test_stderr(self):

        with self.catch_stream("stderr") as stream:

        self.assertEqual(stream, "Error!")


$ pip install streamtest


$ git clone
$ cd streamtest
$ python build install

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for streamtest, version 1.0b1
Filename, size File type Python version Upload date Hashes
Filename, size streamtest-1.0b1-py2.7.egg (5.0 kB) File type Egg Python version 2.7 Upload date Hashes View hashes
Filename, size streamtest-1.0b1.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page