Skip to main content

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

Project description

forthebadge

Build Status Coverage Status

Overview

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

Usage

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:
            sys.stderr.write("Error!")

        self.assertEqual(stream, "Error!")

Installation

$ pip install streamtest

or

$ git clone git@github.com:alice1017/streamtest.git
$ cd streamtest
$ python setup.py 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.

Source Distribution

streamtest-1.0b1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

streamtest-1.0b1-py2.7.egg (5.0 kB view details)

Uploaded Source

File details

Details for the file streamtest-1.0b1.tar.gz.

File metadata

  • Download URL: streamtest-1.0b1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for streamtest-1.0b1.tar.gz
Algorithm Hash digest
SHA256 a1d511ff1303075bfd3557a2990769abc44b2cb7ede9f7391d1a1c64fb5a93e4
MD5 98f854f3091eee85739744dac9a7c9e1
BLAKE2b-256 4dda461330bd5bf4503f3ecfd9f830bb87252855ce9aa4728232dd8c8c6dc8da

See more details on using hashes here.

File details

Details for the file streamtest-1.0b1-py2.7.egg.

File metadata

File hashes

Hashes for streamtest-1.0b1-py2.7.egg
Algorithm Hash digest
SHA256 bf9c0ce5d9bd148a831f383681e0edcdd662d818d3cc859d67c81616d8758fcf
MD5 a85c304d6960bd005d7177ab85e1c557
BLAKE2b-256 e17e97943a6b6588b335d5f3ddec929b2510437290011421b8331fac1920eb58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page