Python unittest.TestCase for testing the output of standard stream(stdout, stderr)
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
streamtest-1.0b1-py2.7.egg
(5.0 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1d511ff1303075bfd3557a2990769abc44b2cb7ede9f7391d1a1c64fb5a93e4 |
|
MD5 | 98f854f3091eee85739744dac9a7c9e1 |
|
BLAKE2b-256 | 4dda461330bd5bf4503f3ecfd9f830bb87252855ce9aa4728232dd8c8c6dc8da |
File details
Details for the file streamtest-1.0b1-py2.7.egg
.
File metadata
- Download URL: streamtest-1.0b1-py2.7.egg
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9c0ce5d9bd148a831f383681e0edcdd662d818d3cc859d67c81616d8758fcf |
|
MD5 | a85c304d6960bd005d7177ab85e1c557 |
|
BLAKE2b-256 | e17e97943a6b6588b335d5f3ddec929b2510437290011421b8331fac1920eb58 |