Skip to main content

pytest plugin that provides a fixture to print onto the PyTest reporting

Project description

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 version supported Python version licence

Read the documentation at https://pytest-print.readthedocs.io/en/latest/ travis build status appveyor build status Code coverage

install

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.

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()
$ 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 ===========================

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

pytest-print-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_print-0.1.0-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-print-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-print-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytest-print-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e40cf5a4f72f38225c702b875508d028f104c1dcd73cb7d2267068fa53aa823a
MD5 59dc467bb989daba5f9e723bfaedd76f
BLAKE2b-256 785ebff0d52b6d6430c511191daa77a8507644d2623234cef1992d57194eebe6

See more details on using hashes here.

File details

Details for the file pytest_print-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_print-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3fdb06f1949771544521afdc34bfaf57357dbbef2f13d81ee113398251b85b91
MD5 015ebb5a02b54322c464ebf4c675bbe0
BLAKE2b-256 626a1a8a52e399ff22da1a6349f9fa9e34fe1dd432f7e4f66cd787f7ababf9ad

See more details on using hashes here.

Supported by

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