Metadata-Version: 2.1
Name: pytest-print
Version: 0.1.0
Summary: pytest plugin that provides a fixture to print onto the PyTest reporting
Home-page: https://github.com/gaborbernat/pytest-print
Author: Bernat Gabor
Author-email: gaborjbernat@gmail.com
License: MIT License
Project-URL: Documentation, http://pytest-print.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/gaborbernat/pytest-print
Project-URL: Tracker, https://github.com/gaborbernat/pytest-print/issues
Keywords: pytest print debug
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.6
Classifier: Framework :: Pytest
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Description-Content-Type: text/x-rst
Provides-Extra: docs
Provides-Extra: lint
Provides-Extra: testing
Requires-Dist: pytest (<4,>=3.0)
Requires-Dist: six (<2,>=1.11.0)
Requires-Dist: typing (<4,>=3.6.4); python_version < "3.5"
Provides-Extra: docs
Requires-Dist: Sphinx (<2,>=1.7.0); extra == 'docs'
Provides-Extra: lint
Requires-Dist: flake8 (==3.4.1); extra == 'lint'
Requires-Dist: flake8-bugbear (==17.4.0); extra == 'lint'
Requires-Dist: pre-commit (==1.8.2); extra == 'lint'
Provides-Extra: testing
Requires-Dist: pytest (<4,>=3.5.0); extra == 'testing'
Requires-Dist: coverage (>=4.5.1); extra == 'testing'

pytest-print
============

Allows to print extra content onto the PyTest reporting. This can be used for example to report sub-steps for long
running tests, or to print debug information in your tests when you cannot debug the code.

|pypi| |support| |licence|

|readthedocs| |travis| |appveyor| |coverage|

.. |pypi| image:: https://img.shields.io/pypi/v/pytest-print.svg?style=flat-square
    :target: https://pypi.org/project/pytest-print/
    :alt: pypi version

.. |support| image:: https://img.shields.io/pypi/pyversions/pytest-print.svg?style=flat-square
    :target: https://pypi.python.org/pypi/pytest-print/
    :alt: supported Python version

.. |travis| image:: https://img.shields.io/travis/gaborbernat/pytest-print/master.svg?style=flat-square&label=Travis%20Build
    :target: https://travis-ci.org/gaborbernat/pytest-print
    :alt: travis build status

.. |appveyor| image:: https://img.shields.io/appveyor/ci/gaborbernat/pytest-print/master.svg?style=flat-square&logo=appveyor
    :target: https://ci.appveyor.com/project/gaborbernat/pytest-print
    :alt: appveyor build status

.. |coverage| image:: https://codecov.io/github/gaborbernat/pytest-print/coverage.svg?branch=master
    :target: https://codecov.io/github/gaborbernat/pytest-print?branch=master
    :alt: Code coverage

.. |licence| image:: https://img.shields.io/pypi/l/pytest-print.svg?style=flat-square
    :target: https://pypi.python.org/pypi/pytest-print/
    :alt: licence

.. |readthedocs| image:: https://img.shields.io/readthedocs/pytest-print/latest.svg?style=flat-square&label=Read%20the%20Docs
   :alt: Read the documentation at https://pytest-print.readthedocs.io/en/latest/
   :target: https://pytest-print.readthedocs.io/en/latest/


install
=======

.. code-block:: sh

   pip install pytest-print

The plugin provides ability to print information during the tests runs.


use cases
=========

sub-step reporting
------------------
For tests that are long running this can provide a feedback ot the end-user that what is just happening in the
background.


.. code-block:: python

   def test_server_parallel_requests(pytest_print, tmpdir):
       pytest_print("create virtual environment into {}".format(tmpdir))
       create_virtual_environment(tmpdir)

       pytest_print("start server from virtual env")
       start_server(tmpdir)

       pytest_print("do the parallel request test")
       parallel_requests()

.. code-block:: sh

    $ py.test --vv
    ============================= test session starts ==============================
    platform linux -- Python 3.6.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
    collecting ... collected 1 item

    test_printer_progress.py::test_server_parallel_requests
        create virtual environment
        start server from virtual env
        do the parallel request test
    PASSED                                                                   [100%]

    =========================== 1 passed in 0.02 seconds ===========================


