Metadata-Version: 2.0
Name: stdio-mgr
Version: 1.0rc1
Summary: Context manager for mocking/wrapping stdin/stdout/stderr
Home-page: https://www.github.com/bskinn/stdio-mgr
Author: Brian Skinn
Author-email: bskinn@alum.mit.edu
License: MIT License
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Classifier: Development Status :: 4 - Beta
Requires: attrs (>=17.1)
Provides: stdio_mgr
Requires-Python: >=3
Requires-Dist: attrs (>=17)

stdio Manager
=============

*Python context manager for mocking/wrapping stdin/stdout/stderr*

.. image:: https://travis-ci.org/bskinn/stdio-mgr.svg?branch=dev
    :target: https://travis-ci.org/bskinn/stdio-mgr

.. image:: https://codecov.io/gh/bskinn/stdio-mgr/branch/dev/graph/badge.svg
    :target: https://codecov.io/gh/bskinn/stdio-mgr

.. image:: https://img.shields.io/pypi/v/stdio_mgr.svg
    :target: https://pypi.org/project/stdio-mgr

.. image:: https://img.shields.io/pypi/pyversions/stdio-mgr.svg

.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
    :target: https://github.com/bskinn/stdio-mgr/blob/master/LICENSE.txt

*README draft in progress.*

Have a command-line Python application? Want to test *[...continued]*



*[more about mocking stdio]*


In addition to mocking `stdio` for testing, `stdio_mgr` can also be used to
wrap functions that directly interact with `stdio`. Example:

.. code::

    >>> def embellish(func):
    ...     def func_wrapper(s):
    ...         from stdio_mgr import stdio_mgr
    ...
    ...         with stdio_mgr() as (i, o, e):
    ...             func(s)
    ...             content = o.getvalue()
    ...         newcontent = '*** ' + content.replace('\n', ' ***\n*** ')
    ...         newcontent = newcontent[:-5]
    ...         print(newcontent)
    ...     return func_wrapper

    >>> @embellish
    ... def testfunc(s):
    ...     print(s)

    >>> testfunc("""\
    ... Foo bar baz quux.
    ... Lorem ipsum dolor sit amet....""")
    *** Foo bar baz quux. ***
    *** Lorem ipsum dolor sit amet.... ***



